We are happy to announce the release of the Snowplow Python Tracker version 0.2.0. This release adds support for Python 2.7, makes some improvements to the Tracker API, and expands the test suite.
This post will cover:
The call to import the tracker module has not changed:
Tracker initialization has been simplified:
Note that the method to set a collector URL based purely on a Cloudfront subdomain has been removed: you should now pass the whole host string “d3rkrsqld9gmqf.cloudfront.net”, not just “d3rkrsqld9gmqf”.
You can also provide a tracker name argument:
Every event fired by
t will have a tracker namespace field with value “cf”. This means that you can match events to the tracker which created them.
There is one other major improvement to the API: tracker methods no longer require you to supply every argument. Arguments which are not supplied default to
None and will not be added to the event. For example, the
track_ecommerce_transaction method takes up to nine arguments, but only
total_value are mandatory. Suppose we want to call
track_ecommerce_transaction with just the two mandatory parameters and the optional
country parameter. This is how to do it:
As part of this change, the order of arguments for certain methods has been changed so that all keyword arguments come after all non-keyword arguments. For more information on which arguments are required and which are not, on the names of keyword arguments, and on the new order of arguments, see the wiki.
The Snowplow Python Tracker is now fully compatible with Python 2.7. Going forwards, we intend to maintain support for both Python 3.3 and Python 2.7, as well as adding support for other Python versions as they are requested.
As well as running the test suite using both Python 2.7 and Python 3.3, we have expanded the scope of the integration tests. Now the GET payload generated by each tracking method is validated, ensuring that the correct data is being sent.
We have also:
- Added an event vendor parameter for events defined by Snowplow #55
- Switched from using pycontract 0.1.4 to PyContracts 1.6.0 #63
- Fixed the dependency versions in requirements.txt #47
- Started sending the platform and tracker version through on the querystring #50
- Linked the Technical Docs and Setup Guide images in the README to the appropriate pages [#60] 
- Changed the tracker version field from “python-0.1.0” to “py-0.2.0” #51
The release version of this tracker (0.2.0) is available on PyPI, the Python Package Index repository, as snowplow-tracker. Download and install it with pip:
Or with setuptools:
For more information on getting started with the Snowplow Python Tracker, see the setup page.