Skip to content

Instantly share code, notes, and snippets.

@tpitale
Forked from mig/gist:151538
Created July 21, 2009 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpitale/151540 to your computer and use it in GitHub Desktop.
Save tpitale/151540 to your computer and use it in GitHub Desktop.
cookies = document.cookie.split(';');
utmz = "";
for(i in cookies) {
if(cookies[i].test(/^__utmz/)) utmz = cookies[i];
}
medium = utmz.match(/".*?utmcmd=([a-z]+)\|/)[1];
adwords = utmz.match(/.*?utmgclid=([_0-9A-Za-z]+)\|/)[1];
if(medium == 'cpc' || adwords) firstTracker._setVar('CPC');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment