Snowplow JavaScript Tracker 1.0.0 released
We are pleased to announce the release of the Snowplow JavaScript Tracker version 1.0.0.
This release adds new options for user fingerprinting and makes some minor changes to the Tracker API. In addition, we have moved to a module-based project structure and added automated testing.
This post will cover the following topics:
- New feature: user fingerprint options
- Changes to the Snowplow API
- Move to modules
- Automated testing
- Removed deprecated functionality
- Other structural improvements
- Upgrading
- Getting help
The Snowplow JavaScript Tracker uses a “user fingerprint” to identify users based on various features of their browser.
This version adds two new functions to control user fingerprinting: enableUserFingerprinting
and setUserFingerprintSeed
.
User fingerprinting is turned on by default, but can be turned off like this:
If you want to choose the seed used to generate the user fingerprint, use setUserFingerprintSeed
like this:
If you do not set a custom hash seed, the default seed will be used instead.
The move to modules has allowed us to tighten our public API, making our helper functions private.
In addition, the global SnowPlow
object has been renamed to Snowplow
. This will only affect users who have implemented the synchronous tracker.
We have organised our code into modules using Browserify. Browserify recursively analyzes the dependencies of the Tracker and combines all the required modules into a single bundle. This allowed us to replace much of our code with external npm modules and a minimal lodash library.
We have started to use Intern for non-functional testing of our asynchronous queue and payload builder modules. We have also added Travis CI to the project. Travis runs the Intern tests every time the Javascript Tracker repository is altered, preventing errors from going unnoticed. We plan to expand the test suite to include functional tests in coming versions.
Five deprecated functions have been removed:
attachUserId
is removed because there is no longer any need to enable or disable specific user IDssetSiteId
should be replaced withsetAppId
getVisitorId
should be replaced withgetDomainUserId
getVisitorInfo
should be replaced withgetDomainUserInfo
trackEvent
should be replaced withgetStructEvent
, the new name for this
Finally, trackImpression
has been deprecated in preparation for the addition of an all-new trackAdImpression
in a coming version.
We have also:
- Added meta-data to our package.json including a description and keywords #83
- Moved the banner into our Gruntfile and dynamically templated in information from our package.json #82
- Removed the legacy Piwik plugin framework #56
- Named our Grunt tasks #86
- Added a “Built with Grunt” badge to the README #102
- Relocated some helper functions for consistency #91
UPDATED After an important post-release bug fix, the updated minified tracker is available here:
http(s)://d1fc8wv8zag5ca.cloudfront.net/1.0.1/sp.js
If you use the path:
http(s)://d1fc8wv8zag5ca.cloudfront.net/1/sp.js
then you will automatically get new semantic-minor versions and patches as they are released.
Check out the v1.0.0 release page on GitHub for the full list of changes made in this version.
As always, if you run into any issues or don’t understand any of the above changes, please raise an issue or get in touch with us via the usual channels.