Snowplow Python Tracker 0.6.0 released
We are pleased to announce the release of version 0.6.0.post1 of the Snowplow Python Tracker. This version adds several methods to help identify users by adding client-side data to events. This makes the Tracker more powerful when used in conjunction with a web framework such as Django or Flask.
The rest of this post will cover:
- Improved logging
- Upgrading and compatibility
- Other changes
- Getting help
ip_address field in the Snowplow event model is used to look up information about a user’s geographical location among other things. If you have access to a user’s IP address, you can add it to all events concerning that user with the
useragent field contains information (sometimes called the “browser string”) about the user’s browser. You can set this field with the
set_domain_user_id method to associate a subject with it:
This is useful if you are tracking events both server-side and client-side and want to know when they concern the same user.
network_userid field is a user ID set by Snowplow’s Clojure Collector and Scala Stream Collector via a third party cookie. Similarly to the
set_domain_user_id method, the
set_network_user_id lets you associate a subject with a network user ID:
The tracker now logs the endpoint to which events are being sent and, at debug level, each individual event. This brings logging up to par with the Ruby Tracker.
Some other improvements have been made to the Python Tracker:
- We have eliminated unnecessary whitespace from the JSON body of POST requests (issue #110)
- Unicode characters in unstructured events and custom contexts are now preserved rather than converted to ASCII (issue #123)
- We have added more integration tests for POST requests (issue #122)
To add the Snowplow Tracker as a dependency to your own Python app, edit your
requirements.txt and add:
This version increases the schema version for the JSON holding your custom contexts to 1-0-1 and the schema for all POST request payloads to 1-0-2. These schema versions aren’t supported by versions of Snowplow before 0.9.14, so please upgrade if you have not already.