Snowplow Ruby Tracker 0.4.0 released

07 November 2014  •  Fred Blundun

We are pleased to announce the release of version 0.4.0 of the Snowplow Ruby Tracker. This release adds several methods to help identify users using client-side data, making the Ruby Tracker much more powerful when used from a Ruby web or e-commerce framework such as Rails, Sinatra or Spree.

The rest of this post will cover:

  1. set_ip_address
  2. set_useragent_user_id
  3. set_domain_user_id
  4. set_network_user_id
  5. Other changes
  6. Getting help

1. set_ip_address

The ip_address field in the Snowplow event model is used to look up information about a user’s geographical location (among other things - see our scala-maxmind-iplookups project for more detail). If you have access to a user’s IP address, you can add it to all events concerning that user with the set_ip_address method:

subject.set_ip_address("37.157.33.93")

2. set_useragent

The useragent field contains information (sometimes called the “browser string”) about the user’s browser. You can set this field with the set_useragent method:

subject.set_useragent("Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 Firefox/23.0")

3. set_domain_user_id

The domain_userid field in the Snowplow event model refers to the user ID set by the Snowplow JavaScript Tracker and stored in the ID cookie. If you extract that ID, you can use the set_domain_user_id method to associate a subject with it:

subject.set_domain_user_id("c7aadf5c60a5dff9")

This is useful if you are tracking events both server-side and client-side and want to know when they concern the same user.

4. set_network_user_id

The 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:

subject.set_network_user_id("ecdff4d0-9175-40ac-a8bb-325c49733607")

Please note that making use of this functionality in Snowplow is dependent on issue #1095 in the core Snowplow project, which has not yet been released.

5. Other changes

Two other changes have been made to the Ruby Tracker “under the hood”:

  1. We are now correctly using SSL for requests over HTTPS (#52)
  2. We are now sending version 1-0-1 of the payload_data schema, to correspond to the four new fields (#45)

6. Getting help

Useful links:

If you have an idea for a new feature or want help getting things set up, please get in touch. This is only the second release of the Ruby Tracker, so we’re keen to hear people’s opinions. And raise an issue if you spot any bugs!