Google Analytics Linking Across Domains
There are two ways in approaching tracking the website across multiple domains using Google Analytics. First, note the difference between “multiple subdomains” and “multiple root domains”.
Example of Multiple Subdomains
www.example_site.com
and
blog.example_site.com
Example of Multiple Root Domains (two different domains)
www.example_site.com
and
www.example_store.com
How to track the subdomains of the website in one profile
1) You can track subdomains within the same profile as the domain by addin an extra line into your tracking code (in bold).
NEW CODE (ga.js)
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
-> pageTracker._setDomainName(“example_site.com”);
pageTracker._initData();OLD CODE (urchin.js)
_uacct = “UA-xxxx-x”
-> _udn=”example_site.com”;
urchinTracker();
Keep in mind that this will allow you to track subdomains within one profile, but you may not be able to distinguish between pages coming from the main domain versus the subdomain.
2) If you need to distinguish between the subdomains, advanced filter for your profile needs to be set.
For Example:
Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output To: Request URI
Constructor: /$A1$B1
How to track the site across multiple domains
1) You need to add the following lines (in bold) to your Google Analytics tracking code.
NEW CODE (ga.js)
var pageTracker = _gat._getTracker(“UA-12345-1″);
-> pageTracker._setDomainName(“none”);
-> pageTracker._setAllowLinker(true);
pageTracker._initData();OLD CODE (urchin.js)
_uacct=”UA-xxxx-x”
-> _udn=”none”
-> _ulink=1;
urchinTracker();
2) Next, you will need to add the _link function to any links between the domains.
Example for new ga.js :
.. href=”http://www.example_store.com”> onclick=”pageTracker._link(this.href); return false;”…
Example old urchin.js :
.. href=”http://www.example_store.com”> onclick=”javascript:__utmLinker(this.href); return false;”…
3) If you send information between domains using forms, you’ll need to apply the following.
Example for new ga.js :
.. action=”http://newdomain.com/form.cgi” onSubmit=”javascript:pageTracker._linkByPost(this)”
Example old urchin.js :
.. action=”http://newdomain.com/form.cgi” onSubmit=”javascript:__utmLinkPost(this)”
4) The data in the report will only include the request URI and not the domain name. If you want to see the domain names, then you need to create an Advanced filter for your profile.
Filter Type : Custom filter > Advanced
Field A : Hostname Extract A : (.*)
Field B : Request URI
Extract B : (.*)
Output To : Request URI
Constructor : $A1$B1
Search
Info | Connect
Ads
Email Sign Up
Recent Posts
- Segmentation Analysis Making Sense of Initial Event to Ultimate Outcome
- Tracking interactions on site and what to plan
- Methodology to set the target for bounce rate to improve consumer experience
- Digital analytics role is not just defined by web analytics or analysts
- Is your company treating data as an asset?
- A Thought on Web Analytics and Big Digital Data
- Social Graph Data and Web Analytics
- 5 Tips to Building Great Web Analytics Vendor Relationship
- Mobile Analytics is Very Unique and Different from Website Analytics
- Getting Ready for Mobile Site or Apps Analytics
Tags
Action Analysis analytics Bounce Content conversion Data goal Google Google Analytics Improve Increase Keywords KPI measure metrics New Opportunities optimization Optimize outcome Page Qualified Visitors reporting satisfaction Search Segment Segmentation Segmentations SEM SEO Site Social Media strategies tagging Terms Tracking Traffic traffic analysis Understand Value visitors Visits Web web analytics
