Edit 4th Feb 2015 - Google have published an email tracking guide with the Measurement Protocol. The below goes a bit beyond that showing how to link the user sessions etc.
The Measurement Protocol was launched at the same time as Universal Analytics, but I've seen less adoption of it with clients, so this post is an attempt to show what can be done with it with a practical example.
The demo app is available here: http://ua-post-to-push.appspot.com/
With this demo you should be able to track the following:
- You have an email address from an interested customer
- You send them an email and they look at it, but don't click through.
- Three days later they open the email again at home, and click through to the offer on your website.
- They complete the form on the page and convert.
Within GA, you will be able to see for that campaign 2 opens, 1 click/visit and 1 conversion for that user. As with all email open tracking, you are dependent on the user downloading the image, which is why I include the option to upload an image and not just a pixel, as it may be more enticing to allow images in your newsletter.
The clever bit is that you can link user sessions together via the CID (Customer ID), so you can track the upcoming Internet of Things off-line to on-line, but also things like email opens and affiliate thank you pages. It also works with things like enhanced e-commerce, so can be used for customer refunds or product impressions.
This demo looks at e-mail opens for its example, but its minor modifications to track other things. For instance, I use a similar script to measure in GA when my Raspberry Pi is backing up our home computers via Time Machine.
Demo on App Engine
This code is available on Github here - http://github.com/MarkEdmondson1234/ga-get-to-post
App running that code is here: http://ua-post-to-push.appspot.com/
There are instructions on Github on how it works, but I'll run through some of the key concepts here in this post.
What the code does
- The homepage explaining the app
- The image URL itself, that when loaded creates the hit to GA
- A landing page with example custom GA tracking script
- An upload image form to change the image you would display in the e-mail.
This does nothing server side aside serve up the page
This is the main point of the app - it turns a GET request for the image uploaded into a POST with the parameters found in the URL. It handles the different options and sends the hit to GA as a virtual pageview or event, with a unique user CID and campaign name. An example URL here is:
This just handles the image uploading and serves the image up via App Engines blobstore. Nothing pertinent to GA here so see the Github code if interested.
Its hoped this helps sell using the Measurement Protocol to more developers, as it offers a solution to a lot of the problems with digital measurement today, such as attribution of users beyond the website. The implementation is reasonably simple, but the power is in what you send and what situations. Hopefully this inspires what you could do with your setup.
There are some limitations to be aware of - the CID linking won't stitch sessions together, it just discards a user's old CID if they already had one, so you may want to look at userID or how to customise the CID for users who visit your website first before the email is sent. The best scenario would be if a user is logged in for every session, but this may not be practical. It may be that the value of linking sessions is so advantageous in the future, entire website strategies will be focused on getting users to ID themselves, such as via social logins.
Always consider privacy: look for user's to opt in, and make sure to use GA filters to take out any PII you may put into GA as a result. Current policy looks to be that if the data within GA is not able to be tracked to an individual (e.g. a name, address or email) then you are able to record an anonymous personal ID, that could be exported and linked to PII outside of GA. This is a bit of a shifting target, but in all cases keeping it as user focused and not profit focused as possible should see you through any ethical questions.