Snowplow JavaScript Trackers v3.11.0 released

Snowplow JavaScript Trackers v3.11.0 released

We are pleased to announce version 3.11.0 of the Snowplow JavaScript Trackers!

Version 3.11.0

New features, fixes and a shift left security enhancement!

On this release, we added the capability to supply a callback to the JavaScript trackers, JavaScript and Browser, to be executed whenever a new session is created on the client side. This callback will give engineers access to a client_session type object with the information about the new session.

newTracker('sp1', '{{collector_url}}', { 
  /* Other options... */
  onSessionUpdate: (clientSession: ClientSession) => void)

This is similar to the mobile trackers session callback functionality.

On the Node.js tracker we implemented two new API methods allowing for easier setting of the session id and session index information for hits sent by the tracker.

Finally we introduced gitleaks in the JavaScript trackers repository to prevent hardcoded secrets like passwords, api keys, and tokens leaking in our git repository.

You can see the whole list of features/fixes/enhancements below:


New features

  • Added a onSessionUpdate option to allow for supplying a callback to be executed whenever a new session is created on the client side. #1191

Bug fixes

  • For dimension-type attributes such as viewport size, we are rounding down the values to the nearest integer, making sure events do not end up in the bad queue. This change has been applied to the canonical properties, but to make sure that a client can detect these unexpected values, we plan to allow fractional values to be tracked on the browser context in a next release. #1195.


New features

  • Add API methods for setting the sessionId and sessionIndex attributes on hits sent from the Node.js tracker. #1178


  • Use gitleaks to detect leaked keys before making their way to the public codebase. #1193


Version 3.11.0 is available as @snowplow/browser-tracker on npm, or as the tag based javascript tracker - available on GitHub Releases, jsDelivr or unpkg.


Hi everybody,

question regarding “onSessionUpdate” callback: would it be possible to build a customer helper based on the callback to send an event “once per session”?

Kind regards.

Hi @davidher_mann,

I think that would be a valid use case of the onSessionUpdate callback. We added the callback to address a similar problem – to track an event whenever a new session is started. Note that if you track an event inside the callback, it might not be the first event in that session, there will likely be one or more events with the same session ID tracked before it.

1 Like