Clickstream Event APIs

The Clickstream Event APIs allow you to capture and process real-time customer interactions across multiple digital touchpoints, such as websites and mobile apps. These APIs are essential for tracking user activities like page views, product clicks, cart updates, and transactions. By analyzing this data, businesses can gain valuable insights into customer behavior, optimize marketing strategies, and create personalized user experiences.

Event Types

This section describes the different types of events captured using the Clickstream Event APIs. Each event type has its specific parameters and structure. These APIs provide a robust mechanism to track various interactions across websites, mobile apps, and other customer-facing platforms.

Common Fields for Clickstream Event

The following table outlines the common fields used in Clickstream Event APIs. These fields are required or optional depending on the event type.

Parameter

Type Required or Optional

Description

srcId

String

Required

Specifies the source of the event.

Example:

  • WBSTR: Defines the source as Web Store.
  • MobileApp: Defines the source as Mobile App.
srcType

String

Required

Specifies the source type.

Example:

  • Shopify: Defines the source type as Shopify eCommerce platform.

  • Website Name: Defines the source type as a website.

  • App Name: Defines the source type as Mobile App.

clientCorrelationId

String

Optional

A unique identifier for the customer, which can be used to correlate events across different systems.

Example: clientCorrelationId="87654321ABCDE12345"

requestTime

Number

Required

The timestamp representing when the event was captured, expressed in milliseconds since January 1, 1970 GMT+0:0 (Unix Epoch).

Example: requestTime=1609459200000

userAgent

Object

Optional

Information about the user's device and browser.

Example: {"browserType":"Firefox", "customerDeviceType":"Mobile"}

session

Object

Optional

Details of the user’s session, including session ID and IP address.

Example: {"sessionKey":"SCBBD2244", "customerIPAddress":"192.168.1.1"}

customer

Object

Required

Customer details, such as customer code and email address.

Example: {"customerCode":12223433, "email":"john.smith@example.com"}

page

Object

Optional

Information about the page where the event occurred.

Example: {"pageName":"Product", "pageUrl":"https://www.example.com/product/12345"}

eventData

Object

Required

Data specific to the event type. The structure of this object varies by event type..

Example: {"productId":"12345", "quantity":2}

eventDateTime

String

Optional

The date and time of the event in the format yyyy-MM-dd HH:mm:ss (UTC).

Example: 2024-08-30 12:30:00

Sample Structure

This section provides wrapper JSON for every event. Definition of all the JSON elements except eventData, mentioned in this section remain as-is.

Copy
{
"srcId":"WBSTR",
"srcType":"Shopify",
"clientCorrelatorId":"5DEF0BF530F749AD46F652BDF3",
"requestTime":12243444223,
"siteHash":"ASADD5DEF0BF530F749AD46F652BDF3",
"sdkVersion":"2020R3",
"appVersion":"3.1.1.1",
"eventType" :"eventHomePage"
"userAgent":{
    "build":""
    "browserType":"Mozilla/5.0",
    "browserVersion":"Firefox/32.0",
    "customerDeviceOs":"IOS",
    "customerDeviceOsVersion":"11.3",
    "customerDeviceType":"Mobile",
    "timezone":"IST",
    "isMobileDevice":"true",
    "screenResolution":"",
    "cookieSupport":"true",
    "language":"us-en"
    "manufacturer":"Apple",
    "model":"iPhone 11",
    "advertisingId":"ABCD-EFGH-IJKL"
    },
"session":{
    “sessionKey":"SCBBD2244",
    “shortLivedCookie”:”SCBBD2244”,
    "customerIPAddress":"172.20.0.198",
    "referrerSourceURL":"www.google.com",
    "referrerName":"google",
    "referrerType":"Search Engine",
    "city":"Chicago",
    "state”:”IL”,
    "country":"US"
    "lat":"",
    "lon":"",
    "cookieId":"5DEF0BF530F749AD46F652BDF3",
    "naturalSearchTerm":"Orange Juices",
    "sessionStartTime":"2015-02-02 23:14 UTC",
    "locale":"en_US"
    },
"customer":{
    "customerCode":12223433,
    "mobile":9876543211,
    "email":"john.smith@example.com",
    "uuid":"5DEF0BF530F749AD46F652BDF3"
    },
"page":{
    "pageKey":12222,
    "pageName":"Category",
    "pageUrl":"www.example.com/category.html"
    },
“utm” :{
    “source”: “utm_src query string param value”,
    “medium” : “utm_med query string param value”,
    “campaign”:”utm_camp query string param value”,
    “urlId” : “t1_urlid query string param value”
},
"storeId":"1222",
"eventDateTime":"2015-02-02 23:14 UTC",
"eventData":{
}
}