Skip to content

Instantly share code, notes, and snippets.

@sandrop
Created August 5, 2011 22:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandrop/1128687 to your computer and use it in GitHub Desktop.
Save sandrop/1128687 to your computer and use it in GitHub Desktop.
Google Analytics Roll Up
// edit usual tracking snippet
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-xxxxxxx-1'],
['_trackPageview'],
['rollup._setAccount', 'UA-yyyyyyyy-1'],
['rollup._trackPageview']
);
// optionally you can set the domain for the roll up account here
// ['_setDomainName'],'.domain.com']
// but it's preferable to do it directly in Google Analytics directly as an
// advanced filter that prepends the hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment