A ScreenView is defined as a change in state on the page. For example, on a web page that uses tabs to identify steps in a process, each tab can be defined as a screenview.
What is a screenview?
The definition of a screenview is specified by the application developer. The client frameworks submit events that are triggered based on changes to the hash value in the URL. These events are categorized as the hashchange event.
Each client framework records the screenview message when it occurs. A screenview can be triggered by the application:
- Explicitly starting an API that notifies the Tealeaf library that a new screenview is loaded.
- Triggering a hashchange on the page URL.
In this case, the Tealeaf library must be configured to track hashchange
events and to use them to infer screenview load.
This is an example screenview message from a checkout page:
{
"type": 2,
"offset": 4672,
"screenviewOffset": 0,
"count": 5,
"fromWeb": true,
"screenview": {
"type": "LOAD",
"name": "billing",
"url": "/index.php/checkout/onepage/",
"referrer": "CheckoutMethod"
}
}
When the ScreenView changes, the client reset the count of steps and assume that the content displayed in the client application was changed to display a new view or screen.
LOAD type
The LOAD type is structured as follows:
{
"type": 2,
"offset": 0,
"screenviewOffset": 0,
"count": 1,
"fromWeb": true,
"screenview": {
"type": "LOAD",
"name": "root",
"url": "/",
"referrer": ""
}
}
Among the properties, these values are present for the LOAD
message:
type
value isLOAD
.name
value is the logical page name.url
value is the relative path from the root for the page URL.referrer
value is the referrer to the current page.
UNLOAD type
The UNLOAD type is structured as follows:
{
"type": 2,
"offset": 40824,
"screenviewOffset": 0,
"count": 12,
"fromWeb": true,
"screenview": {
"type": "UNLOAD",
"name": "root",
"url": "/",
"referrer": ""
}
}
Among the properties, these values are present for the UNLOAD
message:
type
value isUNLOAD
.name
value is the logical page name.url
value is the relative path from the root for the page URL.referrer
value is the referrer to the current page.
Track objects unchanged within a given screenView
When the ScreenView changes, the client frameworks submit a message containing the list of objects on the page that were not changed from their initial values.