Professional Documents
Culture Documents
This spec explains how to use the Google Analytics cookie to track and attribute users to their referral source (keyword, banner ad, etc)
Contents
Problem / Solution Solution Overview Solution Specs
The Problem
When we drive a new user to somesite.com we cannot track the users action beyond the form submit (sign up) using standard Google Analytics tracking. The prevents us from identifying where the user came from. Ie, the keyword, or ad unit that referred them to somesite.com. We call this attribution tracking.
The Solution
A custom tracking system that utilizes the Google Analytics cookie to pass campaign variables into the somesite.com database. Once we correlate a transaction with a referring ad ID we can attribute the user to a specific ad source (keyword, banner ad, email, etc). Once we have attribution tracking in place, we can measure ROI for our media
Solution Overview
1 Prospective customer clicks an ad or organic listing 3 Customer completes sign up form at somesite.com 4 Tracker reads Google cookie, extracts specific campaign variables, and passes them through the registration form as hidden fields
Registration Data
Solution Specs
Write a custom script that extracts the following campaign variables from the Google Analytics cookie and passes it through the lead form as a hidden field: Utmcsr Utmccn Utmcmd utmctr
Where: utmcsr = campaign source Utmccn = campaign name utmcmd = campaign medium utmctr = campaign terms
function readCookie(name) {
We're going to search for the name of the cookie, followed by an =. So create this new string and put it in nameEQ:
var ca = document.cookie.split(';');
Then we go through the array (so through all cookies):
if (c.indexOf(nameEQ) == 0)
We've found what we were looking for. We now only need to return the value of the cookie, which is the part of c that comes after nameEQ. By returning this value we also end the function: mission accomplished.
return null; }
These fields should be alphanumeric and should not require validation. The above fields are not required. Insert the extracted variables into their respective fields and
submit the form as normal. The hidden fields will ne captured in the registration form
and passed through to the ExecSight database.
Your Contact
Dylan Touhey
CMO / Principal
dylan@onenetmarketing.com 250.483.7411 x 101