NB. This release continues with the change we introduced with v2.11.0 to how assets are hosted - rather than hosting the tracker on CloudFront, we now publish the asset to the GitHub release. Users who have previously relied on the CloudFront hosted asset must host the tracker on their own CDN, as is recommended practice. More detail can be found in our v2.11.0 release post.
Read on below for:
- Edge Analytics with activity tracking callback
- Resetting page activity on page view event
- Improving Beacon API support
- Improved error handling in tracker callback
- Removing user fingerprinting
- Updates and bug fixes
- Documentation and help
1. Edge Analytics with activity tracking callback
enableActivityTrackingCallback. Using this callback means that each time a page ping event would normally be sent to the Snowplow collector instead your callback function will be executed with the page activity information.
Below is a complete example of utilising this new functionality to aggregate page activity information and send the event as the page unloads:
Note: For this technique of sending on page unload to work reliably, we recommend initialising the Snowplow tracker with
eventMethod: 'beacon' and/or
stateStorageStrategy: 'cookieAndLocalStorage' (if navigating to a page that also contains the JS Tracker). Using the page unload technique will not work for Single Page Applications (SPA), you would need to send the aggregated event to the Snowplow collector on navigation within your application.
2. Resetting page activity on page view event
With version 2.13.0, when a second (or third, etc) page view is tracked, the activity tracking timing will reset as though this is a brand new reload of the tracker. Using the same example above, this means if a second page view event is created when you are 5 seconds into the first page view, then the activity tracking will fire 10 seconds after the second page view; 15 seconds after the first page view.
3. Improving Beacon API support
With this release we have taken the opportunity to improve the reliability of Beacon in Safari, where we have observed differences in events between Post and Beacon being around 6 to 10% less events when Beacon is used. With this release, we are now always sending the first event using Post. This ensures that Safari correctly sends the required preflight request to ensure that the Beacon API works. With this fix in place, we have seen the difference come down to around 0.5%, often seeing more events for implementations using Beacon as we would expect.
4. Improved error handling in tracker callback
When initialising a tracker, there is an option to specify a callback function on tracker initialisation. If an error occurs in this function then it will prevent the tracker initialisation from completing, stopping any events from sending. We now gracefully handle exceptions that occur within this callback method and allow the tracker to continue to send events.
We will now handle errors such as the one in the example below:
5. Removing user fingerprinting
- There are a growing number of tools that provide visitors on the web with more control of their privacy and what data they share. Today, fingerprinting technology is largely used as a way to circumvent these controls, which we do not believe is right.
- The presence of fingerprinting technology may lead to trackers being blocked, disadvantaging companies who are using the Snowplow technology who are being responsible and transparent with visitors to the website about what data they are collecting and how they are using it.
As part of this effort we have removed the Augur Identity automatic context which utilised fingerprinting to identify users. If you were using this context and wish to continue, we suggest you manually attach the Augur Identity context using the trackers global contexts feature to maintain existing behaviour.
6. Updates and bug fixes
Changelog of updates and bugfixes included in this release:
- Add activity tracking callback mechanism (#765)
- Reset activity on page view (#750)
- Remove user_fingerprint (#549)
- Handle errors in tracker callback (#784)
- Update beacon support to handle “gotchas” (#716)
- Change setup process to use Docker (#782)
- Fix al.optimizely.get is not a function error (#619)
- Further harden the Optimizely integrations (#654)
- Use local sp.js for example pages (#790)
- Change deprecation strings to constants and reuse (#791)
The tracker is available as a published asset in the 2.13.0 Github release:
To upgrade, Snowplow Insights and Open Source users should host the 2.13.0 version of
sp.js asset on a CDN, and load the tracker from there.
There are no breaking API changes introduced with this release, although as mentioned above User Fingerprints will no longer track with any events and the default behaviour on Page View events has changed to reset activity timers.
8. Documentation and help
The v2.13.0 release page on GitHub has the full list of changes made in this version.