We’re pleased to announce the Beta release of the Snowplow JavaScript Tracker v4! We’re looking for feedback and testers before the final release (currently scheduled for the end of October).
Snowplow JavaScript Tracker v4 Beta 1
The release adopts the fetch API for making requests to the Snowplow collector which provides the keepalive option that enables requests to outlive the webpage they were made from.
Performance of the track calls has been improved by making cookie writes async.
Form and link click tracking now support event delegation and don’t require the app to refresh the tracking after page changes.
It’s now easier to manage global context using named tags. Plugins add a new filter
function to enable skipping events. The tracker API on Node.JS has been significantly revised and streamlined also thanks to the use of the fetch API. Other changes include upgrades to the UUID package and removal and deprecation of older plugins.
Enhancements
- Use fetch API instead of XMLHttpRequest both in browser and Node trackers and refactor emitter and event store interfaces (#1337)
- Make cookie writes async by default to improve tracker performance (#1340)
- Add event delegation for form tracking (#1329)
- Add event delegation for link click tracking (#1325)
- Add support for named global context (#1331)
- Add a filter function to plugins to filter out events so that they are not tracked (#1326)
- Add browser-tracker-core default for os_timezone (#1338)
- Revise Node.js initialization API
Upgraded internals and dependencies
- Upgrade UUID to 8.3.2 (#1138)
- Update browser targets for compilation (#1131, #1132)
- Update Node.js to v14 (#1129, #1130)
Removed deprecated functionality
- Remove browser-features, optimizely, ecommerce and consent plugins, deprecate enhanced ecommerce and performance timing plugins and add web vitals by default (#1345)
- Revise default plugins included on the JavaScript tracker (#1147)
Other improvements and fixes
- Change default tracker initialization parameters for JS/Browser v4 (#1144)
- Fix SelfDescribingJson type to allow optional keys in type parameter (#1330)
- Fix newTracker optional typing (#1237)
- Fix newTracker typing to accurately return null or undefined (#1167)
- Fix message when a resource triggers errors (#1341)
Currently working on
Installation
The pre-release is published on NPM as 4.0.0-beta.1
.
For use without NPM, you can download the sp.js
file from the Github release.