Working on POUND-like tracking strings
More on what it’d take to recreate POUND as an open source project. I spent some time exploring potential algorithms for generating the tracking string.
Based on this talk, the general methodology is to create a hash unique to the referring user. Since Google Analytics tracks the article being viewed, the time of the pageview, and the referring domain, we can focus on the two user attributes.
Google generates unique user ID’s but terms of service prohibit us from cloning this value into a custom dimension – the only option is paying for Google Analytics 360º, which exposes the built-in
So for the purposes of this project, I am going to assume that we live in a world where users are accustomed to signing into a website. That gives us the ability to use the User ID. By the way, if you read those docs, you’ll see GA also has a client ID used to designate the cookie locally; however, this is not the same ID you see in the
If we populated the user ID field, I think we could then append a hash that encodes that user ID with some secret (so that we aren’t passing user ID’s around in URL’s). This would then give use the referring user on any pageviews stemming from the visit in the future. Some visits won’t have referring users but they should be attributable to an other channel (or direct/dark).
I think we could use hashids and md5 to create the token. Probably in a lambda service so that we aren’t passing secrets to the client. So long as we know the list of user IDs, we can create a mapping table to turn the tokens back into user IDs. Then we should have standardized the user ID format in a way similar to the BuzzFeed implementation. I think.
Did you enjoy this post?
Signup to receive a weekly email containing my new posts, curated links, and book reviews.