Jump to: navigation, search

Events Structure

Overview

When the Tracker Application monitors the current web page, it generates a series of events, which are represented in JSON format.

There are two available event types:

  • SYSTEM — These events are generated automatically and cannot be configured.
  • BUSINESS — These are additional custom events you can create.
Important
You can configure when an event should be generated by customizing the DSL, but if you need more flexibility you can use the Monitoring JS API.

Common Event Structure

The common event structure is a scaffold for generating System and Business events. In table below, data represents the common structure that is included in both event types.

Field Type Description
eventType String The event type: BUSINESS or SYSTEM.
eventName String The required event name.
eventID String The generated UUID that is used to identify the event.
pageID String The generated UUID that is used to identify the page.
timestamp Number The time stamp for when the event was generated. This is taken from the browser.
category String A list of categories separated by semicolons. For more information, see Managing Categories.
url String The URL of the page where the event was triggered.
languageCode String The current language. This can be configured using the languageCode configuration option in the instrumentation script.
globalVisitID String globalVisitID is a anonymously identifier of a particular device or browser.
visitID String visitID represents a particular session in the browser.
data Object Container for additional data. Which depends on event type and name. See appropriate event below

Example of the Common Event Structure

{
  "eventName": "PageEntered",
  "eventID": "44D25DDB78174DEC8F33E28F96428336",
  "pageID": "9A1AD4389AC34F0A86D3EB04E50D6137",
  "timestamp": 1413979605190,
  "category": "my-category",
  "url": "http://www.genesys.com/products",
  "languageCode": "en-US",
  "globalVisitID": "b5a93936-b2a4-4042-a5e6-0a2b9681c1a9",
  "visitID": "8bd4bbb5-3b1d-4647-9ede-37820b88e343",
  "data": {
    ...
  }
}

System Event Structure

System events have specific values for the following fields:

Field Type Description
eventType String SYSTEM
eventName String The following values are possible:
PageEntered—generated when the user enters a page
PageExited—generated when the user changes location or closes a page
SignIn—generated when the user signs in
SignOut—generated when the user signs out
UserInfo—generated when the user signs in
VisitStarted—generated when the visit is identified
data Object This field should contain specific information, described in System data below.

System data

The value of the System event's data field can vary depending on the name of System event. The following sections provide details about the data provided for each event name.

VisitStarted

The VisitStarted event expands the System event structure with the following value for data:

data field Type Description
userAgent String The window.navigator.userAgent value. This contains information about the name, version, and platform of the browser.
screenResolution String The screen resolution at the moment the event is generated. The format is width x height. For example: "1440x900"
language String The language code from window.navigator, retrieved from the first available of the following objects:

window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage || window.navigator.systemLanguage

timezoneOffset String The timezone offset in milliseconds.
ipAddress String The client IP address.
{
	"eventType":"SYSTEM",
	"eventName":"VisitStarted",
	"eventID":"5E1BA21F69F149F280B028385DF16DC3",
	"pageID":"300E084345EC412F879D5A835F7CA4F6",
	"timestamp":1414074819648,
	"category":"my-category",
	"url":"http://www.genesys.com/products",
	"languageCode":"en-US",
	"globalVisitID":"301438c2-3139-4035-aac0-1c9c8a60c481",
	"visitID":"9ccd9489-6a94-4b45-8813-c1cca010d443",
	"data":{ 
		"userAgent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0",
		"screenResolution":"1680x1050",
		"language":"en-US",
		"timezoneOffset":-10800000,
		"ipAddress":"123.45.67.890"
	}
}

PageEntered

The PageEntered event expands the System event structure with the following value for data:

data field Type Description
urlReferrer String A window.document.referrer value. The referrer property returns the URL of the document that loaded the current document.
localTime String The string representation of the time in the browser when the event was generated.
title String The page title, taken from window.document.title.
{
  "eventType": "SYSTEM",
  "eventName": "PageEntered",
  "eventID": "44D25DDB78174DEC8F33E28F96428336",
  "pageID": "9A1AD4389AC34F0A86D3EB04E50D6137",
  "timestamp": 1413979605190,
  "category": "my-category",
  "url": "http://www.genesys.com/products",
  "languageCode": "en-US",
  "globalVisitID": "b5a93936-b2a4-4042-a5e6-0a2b9681c1a9",
  "visitID": "8bd4bbb5-3b1d-4647-9ede-37820b88e343",
  "data": {
    "urlReferrer": "http://www.genesys.com",
    "localTime": "Wed Oct 22 2014 15:06:45 GMT+0300 (FLE Daylight Time)",
    "title": "English"
  }
}

PageExited

The PageExited event does not have additional data. The event structure is the same as the System event structure, but with the PageExited event name specified:

{
  "eventType": "SYSTEM",
  "eventName": "PageExited",
  "eventID": "E8E6F0926F3642BF889DA5ED4342EFA7",
  "pageID": "9A1AD4389AC34F0A86D3EB04E50D6137",
  "timestamp": 1413982730013,
  "category": "my-category",
  "url": "http://www.genesys.com/products",
  "languageCode": "en-US",
  "globalVisitID": "b5a93936-b2a4-4042-a5e6-0a2b9681c1a9",
  "visitID": "8bd4bbb5-3b1d-4647-9ede-37820b88e343",
  "data": {}
}

UserInfo

The UserInfo event expands the System event structure with the following value for data:

data field Type Description
userID String A unique persistent string identifier that represents a user or signed-in account across devices.
{ 
   "eventType":"SYSTEM",
   "eventName":"UserInfo",
   "eventID":"532BC42B99C341578639A1DF1F2A45D9",
   "pageID":"C90206CA44A2401F9408A1581EF0E258",
   "timestamp":1419437657401,
   "category":"",
   "url":"http://www.genesys.com/products",
   "languageCode":"en-US",
   "globalVisitID":"c9b891e4-ae04-493b-b554-4eba19ad7c58",
   "visitID":"b5c87b28-a00e-4461-961b-d6a01b754838",
   "data":{ 
      "userID":"user@genesyslab.com",
      "name":"Bob",
      "sex":"male",
      "age":30
   }
}

SignIn

The SignIn event expands the System event structure with the following value for data:

data field Type Description
userID String A unique persistent string identifier that represents a user or signed-in account across devices.
{ 
   "eventType":"SYSTEM",
   "eventName":"SignIn",
   "eventID":"DE6826972BDF4820B03FAF5BB7945426",
   "pageID":"C90206CA44A2401F9408A1581EF0E258",
   "timestamp":1419437874950,
   "category":"",
   "url":"http://www.genesys.com/products",
   "languageCode":"en-US",
   "globalVisitID":"c9b891e4-ae04-493b-b554-4eba19ad7c58",
   "visitID":"b5c87b28-a00e-4461-961b-d6a01b754838",
   "data":{ 
      "userID":"user@genesyslab.com",
      "name":"Bob",
      "sex":"male",
      "age":30
   }
}

SignOut

The SignOut event does not have additional data. The event structure is the same as the System event structure, but with the SignOut event name specified:

{ 
   "eventType":"SYSTEM",
   "eventName":"SignOut",
   "eventID":"3CE3204E697640A7986C70CA97F0945C",
   "pageID":"C90206CA44A2401F9408A1581EF0E258",
   "timestamp":1419437925162,
   "category":"",
   "url":"http://www.genesys.com/products",
   "languageCode":"en-US",
   "globalVisitID":"c9b891e4-ae04-493b-b554-4eba19ad7c58",
   "visitID":"b5c87b28-a00e-4461-961b-d6a01b754838",
   "data":{ 
   }
}

Business Event Structure

Business events have the same structure as the common event structure, with additional data specified in the DSL configuration. For example, if your DSL (domain-model.xml) has the following event generation rules:

<event id="TimeoutEvent10" name="Timeout-10" condition="" postcondition="document.hasFocus() === true">
      <trigger name="TimeoutTrigger" element="" action="timer:10000" type="timeout" url="" count="1" />
      <val name="myValueName" value="'myValue'"></val>
</event>

Then the generated Business event is expanded with the additional data:

{
  "eventType": "BUSINESS",
  "eventName": "Timeout-10",
  "eventID": "11030C008B3D45ACADFB32A1B4E01122",
  "pageID": "B501B6EE57EF4E2AA05379D468E772D6",
  "timestamp": 1413990905565,
  "category": "",
  "url": "http://www.genesys.com/products",
  "languageCode": "en-US",
  "globalVisitID": "b5a93936-b2a4-4042-a5e6-0a2b9681c1a9",
  "visitID": "8bd4bbb5-3b1d-4647-9ede-37820b88e343",
  "data": {
    "myValueName": "myValue"
  }
}
This page was last edited on June 7, 2019, at 13:25.
Comments or questions about this documentation? Contact us for support!