Welcome to WebmasterWorld Guest from 107.20.34.173

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Google Analytics Cross Domain

Use GA code across multiple domains including a checkout

     

rwilson

7:43 pm on Jun 8, 2011 (gmt 0)



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!

still

11:17 pm on Jun 27, 2011 (gmt 0)



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.

For example:
<script type="text/javascript"> 

var _gaq = _gaq || [];
_gaq.push(
['main._setAccount', 'UA-30264xx-1'],
['main._setDomainName', 'none'],
['main._trackPageview'],
['rollup._setAccount', 'UA-30264xx-2'],
['rollup._setDomainName', 'none'],
['rollup._setAllowLinker', true],
['rollup._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>


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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month