NotifyVisitors

Tracking Events

Pass event attributes to track NV events.

📘

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 the Web

You can track Custom Events through our Web SDK. You can also track associated event attributes
with it if you want to, as shown below:

nv('event', EVENT_NAME, EVENT_ATTRIBUTES, LIFETIME_VALUE, SCOPE);

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 an Event

Attribute values are passed in the form of Javascript:

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

📘

Important:

Attribute Names should contain only alpha-numerics, white spaces or ‘_’ ; No other special characters are allowed. Recommended names - ‘category’, ‘price_usd’

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 as 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 integrated.
  2. Track once per session.
  3. Track once in a lifetime.

Tracking Event Attributes

This is how you can track Custom Event Attributes for a Custom Event:

nv('event,"Added To Cart", {
    /* Numbers */
    "Product ID" : 137,
    "Price"      : 89.70,
    "Quantity"   : 1,

    /* Strings */
    "Product"    : "Givenchy Pour Homme Cologne",
    "Category"   : "Fragrance",
    "Currency"   : "USD",

    /* Boolean */
    "Discounted" : true
}
lifetimeValue:@"100" Scope:1);

nv('event',"Order Placed", {
    "Amount"             : 807.99,
    "Product 1 SKU Code" : "UHUH789",
    "Product 1 Name"     : "CK Jeans",
    "Product 1 Price"    : 300.09,
    "Product 1 Size"     : "L",
    "Product 2 SKU Code" : "FBHG756",
    "Product 2 Name"     : "Hugo Boss Jacket",
    "Product 2 Price"    : 507.90,
    "Product 2 Size"     : "L",
  
    /* Date */
    "Delivery Date"      : new Date("2017-01-09T00:00:00.000Z"),
        
    "Delivery City"      : "New York",
    "Delivery ZIP"       : "10001",
    "Coupon Applied"     : "BOGO17"
}
lifetimeValue:@"100" Scope:1);

How to Track Complex Event Attributes

● You can pass complex event attributes with NotifyVisitors as Array and Object data types.
● You cannot create segments.
● You can use this data for personalizing your campaigns in the following manner:

You can pass event Attributes that are complex in the following manner to your NotifyVisitors
account:

nv('event',"Order Placed", {
    "Amount"   : 807.99,

    /* Date */
    "Delivery Date" : new Date("2017-01-09T00:00:00.000Z"),

    /* Complex nested data */
    "Products" : [
        {
            "SKU Code": "UHUH789",
            "Product Name": "CK Jeans"
            "Price": 300.09,
            "Details": {
                "Size": "L"
            }
        },
        {
            "SKU Code": "FBHG756",
            "Product Name": "Hugo Boss Jacket"
            "Price": 507.90,
            "Details": {
                "Size": "L",
            }
        },
    ],

    /* Objects */
    "Delivery Address": {
        "City": "New York",
        "ZIP": "10001"
    },

    /* Arrays */
    "Coupons Applied": [
        "BOGO17"
    ]
}
lifetimeValue:@"100" Scope:1);

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

Guidelines

  • Your Custom Event Names will be case sensitive and must be under 50 characters in length.
  • Custom Event Attribute names are also case sensitive and must be under 50 characters in
  • length.
  • String attribute values must be under 1000 characters in length.
  • Custom Event Attributes are of data types like:
    1. String
    2. Boolean
    3. Number
    4. Date
    5. Object
    6. Array
  • Event Attributes for a Custom Event cannot exceed 25 times per data type.
  • You cannot create segments for an Event Attribute value that is an Array or an Object. However, you can use it in personalize campaigns.
  • The initial 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.
  • The integration code loads and initializes NotifyVistiors SDK asynchronously, so that it does not affect the page load time of your website.

Updated about a month ago


What's Next

Tracking Users

Tracking Events


Pass event attributes to track NV events.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.