Tracking Events

Record users action via event API.

📘

Must Read

Before moving onto Tracking Events, it will be most helpful to get a better grasp of System & Custom events and their respective attributes. It will help you to understand the workings of Tracking Events much better.
Click here to view Custom Event Templates to get a good understanding.

NotifyVisitors immediately begins tracking once you integrate the SDK. These are referred to as
System Events, and they start tracking common user interactions with your app and also your
campaigns. Click here to view the System Events that we automatically track for you.
You can create your Custom Events that will track your user interactions, important to your business growth. You can further break down each Custom Event into more Event Attributes as:

  • Quantity
  • Price
  • Category

Granular data like this will enable you to engage more users through personalized and contextual
campaigns through Omni-channels or all channels of engagement.

📘

Important

What you see as “Platform” in the Custom Events of your NotifyVisitors dashboard is the sdk_id and signifies SDK type.
sdk_id 1 = Web
sdk_id 2 = Android
sdk_id 3 = iOS

Tracking Custom Events for Android

You can track various app events and pass an optional callback function as a last parameter if you want to get response from events.

NotifyVisitors.event((String)eventName, (JSONObject)attributes, (String)ltv, (String)scope, callback_function );

Example:-

NotifyVisitors.event("event_a", attributes, "7","2", function(callback){
  alert("event response : " + callback); 
});

Tracking Event Attributes
After NotifyVisitors has been initialized successfully, you can track a Custom Event in the following manner:

var attributes = {
  "name":"john",
  "number":"98987XXXXX",
  "user_score":"340",
  "plan_type":3
};

EVENT_NAME (string)
USAGE: To Name of events like sale, register.

  • It is a string value.
  • Use only Alpha Numerics.
  • You can use white spaces or special characters.
  • You can use underscore ‘_.’

EVENT_ATTRIBUTES (JSON object)
USAGE: These attributes are associated with Users' Event

Attribute values are passed in the form of Javascript:

  • Strings
  • Booleans
  • Numbers
  • Date Attribute values are written using Javascript date objects

Attribute Name should contain only:

  • Alpha-numerics
  • No spaces
  • Only underscore _
  • Name within " "
  • No special characters
  • Attribute ends with ;

LIFETIME_VALUE (integer)
USAGE: For awarding a score point to the user like- 10 or 100

SCOPE (integer)
Usage: The scope of the event defines, whether the event should be tracked every time it occurs, or per session, or once in a lifetime. This parameter is used to minimize the duplication of data in analytics.
It is an integer whose values are as follows :

  1. Track every time the api is called.
  2. Track once per session.
  3. Track once in a lifetime.

Guidelines

  • NotifyVisitors from time to time, send events data in batches. This is done to maintain minimal network usage and preserve the battery life of our user mobiles. (How to Set Event Priority)Your Custom Event
  • Names and Custom Event Attribute names will be case sensitive and must be under 50 characters in length.
  • Keep the String attribute values under 1000 characters in length.
  • Custom Event Attributes are of data types like:
    • String
    • Boolean
    • all subclasses of Number
    • Date
    • Map
    • List
  • Event Attributes for a Custom Event cannot exceed 25 times per data type.
  • You cannot create segments for an Event Attribute value that is a List or a Map. However, you can use it in personalize campaigns.
  • The first data point declared gets synced with NotifyVisitors. It will define the data type for the event attribute.
  • The data type must be consistent with the value that you store against the attribute. Do not change the data type at a later stage because it will no longer flow to your NotifyVisitors dashboard.

📘

Feel free to contact us at [email protected] if you need further help. We're only an email away!