Google Analytics Multiple Tracking Code
Here is a cool trick I have implemented across the EWEA web platform:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-yy']);
_gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_gaq.push(["_trackPageview"]);
_gaq.push(['_setAccount', 'UA- xxxxxxxx-zz'']);
_gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_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>
This goes at the bottom of the
tags and what it does is this:• The “yy” code is for the local site, i.e. our individual event site or our blog.
• The “zz” code is common on all the sites. This gives me a global view over all the sites as to the most popular content across all platforms.