maartenba/GoogleAnalyticsTracker — pull request #2 by pmarflee (2012-02-06 21:11:21+00:00)
Title: Custom variables

I've added support for custom variables. 5 key/value pairs can be stored against a Tracker instance (as per the Javascript Api).

Key/value pairs are serialized to a 'utme' querystring value with the form 8(**...)9(**...). During serialization, if the preceding slot does not contain a value, '!' will be prepended to the value for the current slot, where is the 1-based ordinal position of the current slot. This appears to be the way the Javascript Api serializes custom variables, so I've tried to reproduce this as faithfully as possible.