Skip to content

Instantly share code, notes, and snippets.

@scottwb
Created January 16, 2012 21:59
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 scottwb/1623245 to your computer and use it in GitHub Desktop.
Save scottwb/1623245 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
+ _gaq.push(['_setCampSourceKey', 'utm_source']);
+ _gaq.push(['_setCampMediumKey', 'utm_medium']);
+ _gaq.push(['_setCampContentKey', 'utm_content']);
+ _gaq.push(['_setCampTermKey', 'utm_keyword']);
+ _gaq.push(['_setCampNameKey', 'utm_campaign']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
@eduardocereto
Copy link

This is not needed. These are the default values. The _setCamp* functions should be used only if you want to change the default values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment