Snowplow JavaScript Tracker 2.9.0 released with consent tracking
We are pleased to announce a new release of the Snowplow JavaScript Tracker. Version 2.9.0 introduces first class methods for tracking when users grant or withdraw consent for their personal data to be processed for specific purposes, as well as new and improved form tracking and the ability to make new tracker sessions client-side.
Read on below the fold for:
- Tracking users granting, and withdrawing, consent to have their personal data processed for specific purposes
- Form tracking with more control
- Start new sessions client-side
- Updates and bug fixes
- Upgrading
- Documentation and help
1. Tracking users granting, and withdrawing, consent to have their personal data processed for specific purposes
Against the backdrop of the incoming GDPR and ePrivacy regulations, this release adds new events to track when users give their consent to, and withdraw their consent from, having their personal data processed for specific purposes.
We envision that many digital businesses will want to track the consent of their users against relatively fine-grained “bundles” of specific data usecases, which we model in Snowplow as consent documents.
The two new consent tracking methods are:
trackConsentGranted
for the giving of consenttrackConsentWithdrawn
for the removal of consent
Each consent event will be associated to one or more consent documents, attached to the event as contexts.
Here is an example of a user opted into data collection per a specific consent document 1234
:
2. Form tracking with more control
Form tracking now offers the ability to transform form field data with a callback function, transform()
.
For example, use this to hash the field data before sending it for collection:
Documentation can be found here.
3. Start new sessions client-side
The Snowplow JavaScript Tracker uses a session cookie to determine a session – when the session cookie expires, a new session starts. With this release, a new session can instead be started at any time by calling the newSession
function:
Documentation is found here.
4. Updates and bug fixes
Other updates and fixes include:
- Add
identifyUser
as an alias forsetUserId
(#621) - Make the
newDocumentTitle
variable local (#580) - Enforce that
geolocation.timestamp
is an integer (#602) - Bump the
semver
dependency to 4.3.2 (#625) - Remove
respectOptOutCookie
from the Tracker function comments (#605)
5. Upgrading
The tracker is available to use here:
http(s)://d1fc8wv8zag5ca.cloudfront.net/2.9.0/sp.js
As always, we encourage you to self-host your own copy of the tracker.
There are no breaking API changes introduced with this release.
6. Documentation and help
Check out the JavaScript Tracker’s documentation:
- The setup guide
- The full API documentation
The v2.9.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.