Snowplow Node.js Tracker 0.4.0 released

We’re pleased to announce the release of version 0.4.0 of the Snowplow Node.js Tracker.

This release improves the developer experience by adding type support, introduces a new emitter based on the got library, bumps the snowplow-tracker-core library to the latest version, adding support for new properties as well as a number of under the hood improvements and bug fixes.

You can install the Snowplow Node.js Tracker with NPM or Yarn:

npm install snowplow-tracker

or

yarn add snowplow-tracker

If you are already using the snowplow-tracker library, and wish to upgrade, then as this is a pre-1.0.0 release you will need to force installation to the latest or specific version rather than using npm update.

npm install snowplow-tracker@latest

New API Documentation
You can find API documentation for this release available here: https://snowplow.github.io/snowplow-nodejs-tracker/
Documentation on docs.snowplowanalytics.com will be updated shortly (this post will be updated when available).

Breaking Changes
This release contains two breaking changes.

  1. emitter is no longer available. This was based on the deprecated request library so has now been removed in favour of the new got library.
    You should switch from emitter to gotEmitter which continues to offer the same functionality but also includes a number of new features.
    Note there are some differences in the API when creating a gotEmitter, take a look at the gotEmitter documentation here: https://snowplow.github.io/snowplow-nodejs-tracker/modules/got_emitter.html

  2. If you are using trackEcommerceTransaction and passing in an array of items, you should now switch to using trackEcommerceTransactionWithItems. This change was made as previous the Node.js tracker releases overwrote the trackEcommerceTransaction function from snowplow-tracker-core so it wasn’t available. This change makes the API clearer and allows the original trackEcommerceTransaction available in snowplow-tracker-core to be used. You can find the documentation on this function here: https://snowplow.github.io/snowplow-nodejs-tracker/interfaces/tracker.tracker.html#trackecommercetransactionwithitems

New Features
Add setNetworkUserId method (#23)
Add setDomainUserId method (#24)
Add support for dvce_sent_tstamp (#27)
Switch from ‘request’ to ‘got’ (#61)
Bump snowplow-tracker-core to 0.9.1 (#58)
Add Typescript support (#13)

Bug Fixes
Update flush to not send a request if the buffer is empty (#53)

Under the hood
Update project dependencies (#49)
Switch to RollupJS for building ES Module and CJS versions (#57)
Bump NodeJS to support active LTS releases (#55)
Switch out Mocha for Ava (#59)
Switch to GitHub Actions (#54)
Add Snyk support (#60)
Remove Vagrant image (#56)

1 Like

Has anyone gotten this to work in their Node application? Alternatively, when do we think additional docs will be ready? I’m getting silent fails attempting to track Structured Events on my server.

Hi @nikolaswise
Are you using snowplow-tracker v0.4.0 or @snowplow/node-tracker v3.0.0?

The complete docs are in progress for v3.0.0 and will be published by the end of the week. However, the README contains most of the information to get started (@snowplow/node-tracker - npm) and along with the published types the altered APIs should be quite discoverable.
We’ve also published some generated docs for v3 on GitHub.

The docs for v0.x releases are here: Node.js Tracker - Snowplow Docs (and it’s where v3’s final docs will be published)

If you want to share some snippets too then we can look at helping out there too, it might be easiest to start a new thread for that though.

Ah yes, I’m using the @snowplow/node-tracker v3.0.0 – I’ll start a thread with a sample: @snowplow/node-tracker v3.0.0 Failing silently