Snowplow JavaScript Tracker 2.15.0 released


We are pleased to announce a new release of the Snowplow JavaScript Tracker.
Version 2.15.0 introduces two key features around user identification: anonymous tracking capabilities and support for Chrome’s Client Hints (that will replace the traditional useragent string). It also comes with some minor improvements and bug fixes.
Read on below for:
- Anonymous Tracking
- Support for Chrome’s Client Hints
- Other features and bug fixes
- Upgrading
- Documentation and help
1. Anonymous Tracking
The Snowplow technology is built from the ground up for maximum flexibility and control. In an age of incerasing awareness of user privacy, this should include giving users the ability to decide whether or not they want to track persistent user identifiers with their Snowplow web events. Therefore, we are introducing anonymous tracking capabilities into the Snowplow JavaScript tracker (Github issue). Specifically, we are providing two techniques, full anonymous tracking and anonymous session tracking. By default anonymousTracking: false
.
Recommended configurations when using anonymousTracking:
{
anonymousTracking: true,
stateStorageStrategy: 'cookieAndLocalStorage' //allows for event buffering
}
or
{
anonymousTracking: { withSessionTracking: true },
stateStorageStrategy: 'cookieAndLocalStorage'
}
If using the anonymous session tracking, the session information is stored in a cookie or local storage, depending on the stateStorageStrategy
, but no user identifiers are used that exist beyond the users current session. By using a stateStorageStrategy of cookieAndLocalStorage
or localStorage
the event buffering technology in the tracker can continue working. If you wish to configure the JavaScript Tracker to not use any browser storage then you should use stateStorageStrategy: 'none'
.
More information on how to instrument anonymous tracking can be found in the technical documentation.
You may wish to toggle this functionality on or off during a page visit, for example when a user accepts a cookie banner you may want to disable anonymous tracking, or when a user logs in to your site. Information on how to instrument this can be found in the technical documentation. You should also update the stateStorageStrategy
when disabling anonymous tracking, by passing a parameter to disableAnonymousTracking
method, so that event buffering and user tracking can start to work if your stateStorageStrategy
was initially set to none
.
2. Client Hints
The Chrome team have announced that the User Agent will be frozen from Chromium 85 onwards, and will be replaced by “Client Hints” (Explainer: Reducing User-Agent Granularity). Client Hints offer useful information to understand browser usage without the potential to infringe on a users privacy as is often the case with the User Agent string.
Version 2.15.0 of the Snowplow JavaScript tracker comes with support for these Client Hints. If enabled in the tracker initialization, a custom context will be sent with each event.
Specifically, the context be enabled in two ways:
{
clientHints: true
}
This will capture the “basic” client hints.
{
clientHints: { includeHighEntropy: true }
}
This will capture the “basic” client hints as well as hints that are deemed “High Entropy” and could be used to fingerprint users. Browsers may choose to prompt the user before making this data available.
More information on Client Hints can be found in the technical documentation.
3. Other features and bug fixes
This tracker also comes with a few other minor features and bug fixes:
- Support for callback after trackEvent (Github issue #30).
- Return full element in transform function within form tracking (Github issue #825).
- Make browser feature fields optional (Github issue #810</a>); more information can be found in the techical documentation.
- Metric GET failure no longer blocks queue executing (Github issue #769</a>); this was an external contribution from
IArny
, thank you very much! - Ability to set connection timeout (for slow 3G) (Github issue #642</a>); more information can be found in the techical documentation.
- Change initial page ping to fire at minimum visit length when less than heart beat delay (Github issue #803</a>); this was an external contribution from
abiswas-tgam
, thank you very much!
4. Upgrading
The tracker is available as a published asset in the 2.15.0 Github release:
To upgrade, Snowplow BDP and Open Source users should host the 2.15.0 version of sp.js asset on a CDN, and load the tracker from there.
5. Documentation and help
Check out the JavaScript Tracker’s documentation:
- The setup guide
- The quickstart guide
- The full API documentation
- The documentation on the Google Tag Manager custom template
- The documentation on the Analytics npm package
The v2.15.0 release page on GitHub has the full list of changes made in this version.
Finally, if you run into any issues or have any questions, please raise an issue or get in touch with us via our Discourse forums.