Implementing Cross-domain Tracking
The _setAllowLinker( ) Method
In addition to the _setDomainName method, you will need the _setAllowLinker method to enable cross-domain tracking within Google Analytics. This method allows different websites to share the cookie information via URL parameters. The syntax is as follows:
Step 1: Modifying Your GATC for Cross-domain Tracking
You will first need to add the _setDomainName and _setAllowLinker methods into your GATC on all pages for both websites.
For cross-domain tracking, use the following parameter to configure the_setDomainName method:
You can either manually enter these methods into your existing GATC or you can grab the GATC code for cross-domain tracking from your profile settings screen as shown in the following screen shot:
Step 2: The _link( ) Method
The _link() method enables Google Analytics to pass the cookie information across different domains (e.g. mysite.com and oursite.com) using URL parameters. Here is how you can use this method to modify your outbound links which are sending traffic from www.mysite.com to www.oursite.com.
<a href="http://www.oursite.com" onclick="_gaq.push(['_link', 'http://www.oursite.com']);return false;">Go to our site </a>
Step 3: Cross-domain Tracking and Custom Filters
In Google Analytics, reports will only include the requested URI from the respective domains and you will not see the host name associated with each URI. Apply the following filter to resolve this challenge:
Once this filter is applied, Google Analytics will show the following outcome in the Top Content report section: