We are delighted to announce the release of the first version of the Snowplow Node.js Tracker. This is an npm module designed to send Snowplow events to a Snowplow collector from a Node.js environment.
This post will cover installing and setting up the Node.js Tracker and introduce its main features.
You will need to have Node.js and npm installed – see this gist for help with this step.
Install the tracker like this:
For more information, see the [setup page][setup].
Require the tracker module like this:
tracker is the function which constructs the tracker instance. This is its signature:
endpointis the collector to which events will be sent
namespaceis a name for the tracker instance which will be attached to all events that it sends, making it easier to identify their source
appIdis the application ID
encodeBase64is whether unstructured events and custom contexts should be base 64 encoded. It defaults to
Create a new tracker instance like this:
You can set additional information which will be attached to every event:
Send some events:
For more information on using the Node.js Tracker, see the wiki page.
The Node.js Tracker’s functionality is very similar to that of the Snowplow Ruby Tracker and Snowplow Python Tracker. It supports all the same events, as well as for unstructured events and custom contexts.
If you need help getting set up or want a new feature, please get in touch. This is only the first release of the Node.js Tracker and we’re keen to hear people’s opinions. Finally, raise an issue if you find any bugs!