|Google Analytics Cross Domain|
Use GA code across multiple domains including a checkout
I want to use GA across several domains including a yahoo merchant checkout. I have a "corporate" site, a "store" site and a secure checkout domain that currently have separate GA profiles.
I think in order to have cross-domain analytics you need a different tracking code. Has anyone done this or similar? What happens to my existing profiles? is there a way to make one of these existing accounts the new "main" account?
Any help would be appreciated!
Way I set it up in the past is to have a separate profile for rollup reporting to track round trips, as well as domain specific one.
var _gaq = _gaq || ;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
Then depending on how many outbound links you have to your other domains you either tag each manually or put together a script to automate it for you.
Onclick for outbound link (I also include an event to see outbound links in main profile) :
_gaq.push(['main._trackEvent', 'External Link', 'Asset' , 'http://otherdomain.com']);_gaq.push(['rollup._link', 'http://otherdomain.com']); return false;
Lastly, in your rollup profile, create a filter to append the hostname to your URI so you can tell them apart.
Hope that helps.