Tracker Functions
The Boost tracker exposes a function that you can call on your website if you want more control over your tracking. By default everything is automatically collected, but you can disable this using data-auto-track="false"
and sending the data yourself. See Tracker Configuration.
Functions
Pageviews
Tracks a page view.
By default the tracker automatically collects the following properties:
hostname
: Hostname of serverlanguage
: Browser languagereferrer
: Page referrer- screen`: Screen dimensions (eg. 1920x1080)
title
: Page titleurl
: Page urlwebsite
: Website ID (required)
If you wish to send your own custom payload, pass in an object to the function:
The above will only send the properties website
, url
and title
. If you want to include existing properties, pass in a function:
Events
Tracks an event with a given name.
Event Data
Tracks an event with dynamic data.
When tracking events, the default properties are included in the payload. This is equivalent to running:
Event Data Limits
Event Data can work with any JSON data. There are a few rules in place to maintain performance.
- Numbers have a max precision of 4.
- Strings have a max length of 500.
- Arrays are converted to a String, with the same max length of 500.
- Objects have a max of 50 properties. Arrays are considered 1 property.
Session Data
Tracks a session with dynamic data. You would call the identity function from the tracker script to save data about the current session.