Introduction to Omnisense

Omnisense is an omnicanal CRM.

With Omnisense, you can manage the entire lifecycle of your users : Acquisition, Segmentation, Reengagement.

Acquisition : Omnisense is connected to the main advertising companies of the market and will allow you to manage your acquisition easily.

Segmentation : Retrieve all your user data within a clear and intuitive interface and segment them in a few clicks.

Reengagement : Push, mails, sms ... You can reengage your users with all possible and unimaginable means...

Implementing Omnisense javascript SDK on your website

The Javascript Omnisense SDK has 2 main purposes:

Dependencies :

And... that's all !

Initialization

First of all, include Omnisense.js in all your pages.

Once the page is fully loaded, you can initialize Omnisense. To do so, you must set your Omnisense instance identifier and API KEY, which have been provided by the Omnisense Team.

    var API_KEY = "1234567890abcdef09876543210abcde";
    var IDENTIFIER = "my_instance_name";

    var omnisense = new Omnisense(API_KEY, IDENTIFIER);

    omnisense.start();

On first call of start() function, a cookie with a unique identifier is created to identify the user wheter he is connect or not.

Once start function has been called, you can now send user's data and actions.

Send user's informations

Function name : updateUser

Params :

This function should mainly be called on login/signup page, or on user's profile page when he wants to update his informations.

Available attributes for user :

Examples :

Example 1 - User Registration

Let's say the user is registering. Once he clicks the signup button, we can update his profile on Omnisense :

    omnisense.updateUser({
        "email": "emailaddress@provider.com",
        "first_name": "John",
        "last_name": "Doe",
        "lang": "fr",
        "country": "FR",
        "postal_code": "66000"
    });

Example 2 - User Login

Let's say the user is logging in. Once he clicks the login button, we can update his profile on Omnisense :

    omnisense.updateUser({
        "email": "emailaddress@provider.com"
    });

Example 3 - Metadata

If your want to store any other informations not matching the attributes allowed for the user, you have to use the metadata param. You can only store set of key/values in metadata.

    omnisense.updateUser({}, {
        "purchase_count": "5",
    });

Track user's actions

Function name : trackEvent

Params :

This function should mainly be called when an important action occurs, typically, when a user go on a product page, put in in the cart, or when he purchases it.

Example

    productParams = {
        "id": "1234",
        "name": "foo",
        "price": "25",
        "currency": "EUR",
        "media": "website"
    }

    omnisense.trackEvent("product.view", productParams);
    //or
    omnisense.trackEvent("product.view", productParams, function() {
        //Callback, you can do whatever you want here.
    });

Additional settings

The Javascript sdk send automatically a flag indicating the informations are tracked from "website". If you want to change this flag, you can by calling setOrigin function. Call it before calling start function, otherwise you could send the wrong flag to Omnisense.

    //I'm on a mobile website
    omnisense.setOrigin("mobile_website");