Snowplow JavaScript Tracker v4 Beta release

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

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

  • Migrate html5 plugin to v2 media schemas (#1344)
  • Migrate YouTube plugin to v2 media schemas (#1342)

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.

7 Likes

We are pleased to announce the second beta release of the v4 tracker!

The release is published on NPM as 4.0.0-beta.2.
For use without NPM, you can download the sp.js file from the Github release .

Enhancements

  • Migrate to v2 Medai for HTML5 Plugin (#1344)
  • Migrate to v2 Media for YouTube plugin (#1342)
  • Support events on buttons/links/forms in ShadowDOMs (#1351)
  • Use capture-phase listeners for button click tracking (#1348)
  • Switch to GA4 as default for gaCookies plugin (#1349)
  • Disable b64 for SDJ data on POST requests from browsers by default (#1352)
  • Update discoverRootDomain default behaviour (#1350)

Bug fixes

  • Fix SelfDescribingJson type regression from #1330 (#1347)
  • Fix GA cookies unit tests broken by #1349 (#1353)
1 Like

We have published a new beta release: 4.0.0-beta.3

The release is published on NPM as 4.0.0-beta.3 .
For use without NPM, you can download the sp.js file from the Github release .

Enhancements

  • Enable batching multiple events into a single POST request over buffer size if maxPostBytes setting is followed (#1356)
  • Make base64 encoding an optional parameter in Node newTracker call (#1354)

We have published the fourth beta release!

The release is published on NPM as 4.0.0-beta.4 .
For use without NPM, you can download the sp.js file from the Github release .

Enhancements

  • Read the request response to avoid overlapping requests to collector (#1358)
  • Update uuid package dependency to version 10.0.0 (close #1305)