Here’s my analytics tip for the day - fire multiple Google Analytics profile tags on every page.
I have a dummy profile which tracks all my traffic on all my main sites. So when a page loads on say rawtop.com I fire the Google Analytics tag for rawtop.com, but I also fire the tag for my umbrella analytics profile.
When you set up a Google Analytics profile it asks for the site URL. Just put in a dummy URL - the URL you enter doesn’t actually change anything about what’s tracked. You can execute the code on other sites.
Here’s what the code would look like. I’ve had to change the script tags so they’ll display here - so there’s a space in after ‘<’ and before ‘script’ (be careful if you copy and paste)…
< script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
< script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1234567-8");
pageTracker._trackPageview();
} catch(err) {}
try {
var xxTracker = _gat._getTracker("UA-1234567-XX");
xxTracker._trackPageview();
} catch(err) {}</script>
There are typically two script tags for Google Analytics. The first one stays as it is. What you’re doing is 1) duplicating what’s in the second script tag, 2) changing the name of pageTracker in the second instance (to whatever you want except pageTracker) and 3) changing the UA number to reflect the UA ID for the new combo profile you created.
Obviously, the UA IDs have been made generic - use your own UA IDs… But that’s about it…
I should mention that the way it’s set up if a user goes from one of your sites tracked under your umbrella profile to another of the sites under the umbrella profile it will create two visits - one on each site. If you want that to be one visit rather than two there is a way to carry the visit information from the first site to the second, but it’s a bit complicated.