Snowplow JavaScript Tracker v2.18.0 released

We’re pleased to announce a small release of the Version 2 JavaScript Tracker brings the recent improvements from v3.0.3 and v3.1.0 to the v2 releases.

Updates to clearUserData()

clearUserData now clears all session and user identifiers, including those stored in the memory of the tracker, rather than only clearing the cookies. This ensures if any subsequent tracking happens following deleting the Snowplow cookies, that no identifiers will remain in memory and be used for future events.

If you’d like to preserve the session, so that future events on the same page are part of the same session, you can specify the preserveSession flag which will give you the same behaviour as previous releases. There is also a preserveUser flag for preserving the domain_userid and custom user_id properties.

window.snowplow('clearUserData', true, true);

Updates to enableAnonymousTracking()

You can now toggle stateStorageStrategy when enabling anonymous tracking, not only when disabling it.

This means if you want to disable storage again, you can do so when toggling anonymous tracking on.

window.snowplow('enableAnonymousTracking', true, 'none');

Other changes

Fix race condition when using Form and Link Click tracking (#962)

Upgrade steps

You can find the latest release on GitHub:

You can also find the assets on the jsDelivr and cdnjs CDNs: