homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: Receptional & mademetop

Website Analytics - Tracking and Logging Forum

Google Analytics Cross Domain
Use GA code across multiple domains including a checkout

Msg#: 4323609 posted 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!



Msg#: 4323609 posted 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 || [];
['main._setAccount', 'UA-30264xx-1'],
['main._setDomainName', 'none'],
['rollup._setAccount', 'UA-30264xx-2'],
['rollup._setDomainName', 'none'],
['rollup._setAllowLinker', true],

(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);


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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved