Extracting Traffic Source From a Google Analytics Cookie
We recently posted a blog about the importance of monitoring traffic source beyond the web enquiry.
Achieving this technically can be done in many ways, but if you use Google Analytics, it’s already extracted and stored in a series of cookies. The idea is that you can append this referrer info to your submitted enquiries, and pull it into your CRM system. In aggregate this allows you to optimise your marketing activity by seeing which sources and keywords generate the most successful enquiries and sales offline.
The __utmz GA cookie stores traffic source info, specifically:
- Domain Hash
- Timestamp when cookie was set
- Session number
- Campaign number
- Campaign source
- Campaign name
- Campaign medium
- Keyword (last click)
Most of the ‘campaign‘ info is dependent on you using utm_campaign tags in your marketing URLs, but importantly Google records the ‘campaign medium’ reference as ‘organic’ and still picks up the keyword in the case of an organic visit.
We’d recommend you read this blog post which explains in more detail the syntax of the info in this and other GA cookies (would capturing number of pageviews stores in __utmb & __utmc also be useful for you?).
What you’ll need to do is write a script that, upon form submission, reads the info you want from the above cookie, and submits it as a hidden field in your enquiry form, to be stored in your CRM system. You’ll be best placed to know how to do this, but we’ve found a couple of examples of scripts written by other people that you might be able to use as a start point:
Our Conversion Analytics team are accredited in Google Analytics, so get in touch if you’d like to discuss this, or any other analytics ideas further!