Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Tracking events

Any action of interest done by a user is an event. For example, in case of an e-commerce website when a user adds an item to the shopping cart, the website would want to record the "Added to Cart" event along with the product details and price. Events may also be actions carried out by your system in the context of a user, say to track the user's inactivity or to notify departure of a shipment.

Each event has a name and an optional set of attributes describing the event in detail as necessary. An event attribute is a piece of data associated with an event. In the above example, product details and price are the “Added to Cart” event attributes. We recommend you make your events human readable - as an example, you can use a verb in the past tense like “Product Searched” and “Added to Cart”.

Event tracking lets you track user actions on your website, which enables you to create user segments and engagement campaigns based on this activity. We have put together a list of event templates for you to refer to.

System events

WebEngage starts tracking some events automatically as soon as you integrate the SDK. These are called System Events and they track your users’ interactions with your website and campaigns. System events make it easier to analyze user behavior and optimize your marketing around common business goals such as driving user registrations or purchases. You can use custom events for any other user actions you want to track.

Following is the list of WebEngage system events.

Event
Event name

User Login

user_logged_in

User Logout

user_logged_out

Campaign Conversion

goal_accomplish

Push (Web) Accepted

push_notification_accepted

Push (Web) Rejected

push_notification_rejected

Push (Web) Dismiss

push_notification_close

Push (Web) Impression

push_notification_view

Push (Web) Click

push_notification_click

Push (Web) Registered

push_notification_registered

Push (Web) Unregistered

push_notification_unregistered

Web Push Subscribe Viewed

push_notification_window_view

Web Push Subscribe Denied

push_notification_window_denied

Web Push Subscribe Successful

push_notification_window_allowed

Web Push Subscribe Notification Viewed

push_notification_prompt_view

Web Push Subscribe Notification Denied

push_notification_prompt_denied

Web Push Subscribe Notification Allowed

push_notification_prompt_allowed

Notification (On-site & In-app) Impression

notification_view

Notification (On-site & In-app) Close

notification_close

Notification (On-site & In-app) Click

notification_click

On-site Feedback Close

feedback_close

On-site Feedback Submit

feedback_submit

On-site Survey View

survey_view

On-site Survey Close

survey_close

On-site Survey Complete

survey_complete

On-site Survey Submit

survey_submit

Custom events

Custom events enable you to track user actions in your app. Events can be tracked using the track method of WebEngage Web SDK.

Constraints:

  • Event names must be less than 50 characters long.
  • Event attributes can be of these data types: String, Number, Boolean, Date, Array, Object.
  • Event attribute names must be less than 50 characters long. String type attribute values must be less than 1000 characters long.
  • You cannot start your event or event attribute names with we_.
  • You can create at most 25 event attributes of each data type across all instances of an event.
  • If event attribute value is Array or Object, it cannot be used to create user segments. It can only be used to personalize campaigns.

Use webengage.track to send an event with some (optional) associated data to WebEngage as illustrated below.

webengage.track(eventName, [eventData]);

1. Event names are case sensitive.
2. eventName must not start with we_. Event names starting with we_ are reserved for WebEngage's internal use, and will be ignored if used for custom events.
3. For custom events, the first datapoint synced to WebEngage defines the data type for that event attribute in WebEngage. Therefore, data types must be consistent with the data that you want to store for the attribute. If you change the data type later, attribute data will stop flowing to WebEngage.

You can pass event data as illustrated below.

webengage.track("Added To Cart", {
    /* Numbers */
    "Product ID" : 1337,
    "Price"      : 39.80,
    "Quantity"   : 1,

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

    /* Boolean */
    "Discounted" : true
});

webengage.track("Order Placed", {
    "Amount"             : 808.48,
    "Product 1 SKU Code" : "UHUH799",
    "Product 1 Name"     : "Armani Jeans",
    "Product 1 Price"    : 300.49,
    "Product 1 Size"     : "L",
    "Product 2 SKU Code" : "FBHG746",
    "Product 2 Name"     : "Hugo Boss Jacket",
    "Product 2 Price"    : 507.99,
    "Product 2 Size"     : "L",
  
    /* Date */
    "Delivery Date"      : new Date("2017-01-09T00:00:00.000Z"),
		
    "Delivery City"      : "San Francisco",
    "Delivery ZIP"       : "94121",
    "Coupon Applied"     : "BOGO17"
});

Complex event attributes

WebEngage allows you to pass complex event attributes as Array and Object data types. You will be able to use these complex attributes to personalize campaigns as shown below.

Note that you will not be able to use complex attributes as segment filters, as you can see in the segment creation screen below.

You can pass complex event attributes as illustrated below.

webengage.track("Order Placed", {
    "Amount"   : 2300,

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

    /* Complex nested data */
    "Products" : [
        {
            "SKU Code": "UHUH799",
            "Product Name": "Armani Jeans"
            "Price": 300.49,
            "Details": {
                "Size": "L"
            }
        },
        {
            "SKU Code": "FBHG746",
            "Product Name": "Hugo Boss Jacket"
            "Price": 507.99,
            "Details": {
                "Size": "L",
            }
        },
    ],

    /* Objects */
    "Delivery Address": {
        "City": "San Francisco",
        "ZIP": "94121"
    },

    /* Arrays */
    "Coupons Applied": [
        "BOGO17"
    ]
});

Tracking events