Tracking Context data
Context data represents view (page or mobile screen) made by one visitor. Context data contains the circumstances of the event. The URL, Timestamp, the Page Title and URL, Referring URL, as well as the Visitor Anonymous ID.
When to send
- Every time a Page or Mobile screen is viewed. This represents one “Hit”. This means that this data should be sent for every single tracked interaction a visitor has with your platform.
- As Context data is provided for every hit, all other Events should include Context data. You can see examples of this in the JSON Examples for other events.
Data Specification
JSON Attribute | Type | Required | Description |
DistilAccountId | String | Yes | The provided account id you must provide to ensure your data is recorded correctly. |
AnonymousUserID | GUID | Yes | A GUID generated and placed into a Cookie that identifies users across multiple sessions. See Generating Anonymous Visitor Ids. |
Device | String | Yes | This is an information string that identifies the visitor’s device. In the case of a web-browser use the User-Agent-String (see JSON example). In the case of Mobile, use the Device Information. |
EventTimestampUTC | Timestamp | Yes | The Timestamp of the Event in UTC (GMT). |
EventTimestampLocal | Timestamp | Yes | The Timestamp of the Event in the Visitors local time. |
PageTitle | String | Yes | The title of the Page. |
PageUrl | String (URL) | Yes | The full page URL, including any query parameters (i.e. ?a=b&c=d etc) |
ReferrerUrl | String (URL) | Yes | The URL of the page prior to the one being called. |
Generating Anonymous Visitor Ids
Each visitor to your site should have a unique id. This should be a GUID / UUID (i.e. c9a29d9d-26b6-4f79-94d6-56c0af20394a). For first time visitors the Visitor ID should be generated and placed into a Tracking Cookie in the visitors Browser. A reasonably lengthy expiry, for example 1 year rolling, is advised.
When a Visitor returns and the cookie has been found, the Visitor ID contained in the Tracking Cookie should be used in the Context Data. This is used to tie together multiple Sessions by the same Visitor as well as tracking through all the interactions that led to an Order being placed.
Example JSON
"Context": {
"DistilAccountId": "abc-123",
"AnonymousUserID": "f7692ca5-cfd1-4604-81c8-bb8cda4908e0",
"Device Information": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5)",
"EventTimestampUTC": "2017-03-14 23:02:17",
"EventTimestampLocal": "2017-03-14 23:02:17",
"PageTitle": "A Fistful of Dollars",
"PageUrl": "https://www.imdb.com/title/tt0058461/",
"ReferrerUrl": "https://www.google.com/search?biw=1680&bih=970&ei=FC6BXO"
}