Reading Time: 3 minutes

One of the greatest strengths of Google Analytics, besides its powerful reporting capabilities, is being able to go out of the box for most analytical scenarios. In certain situations, however, successful implementation requires that the default tracking code first be modified. One such case is cross-domain tracking.

Cross-domain traffic is the accumulated traffic your college website receives across multiple domains. “When your college website uses a multiple of different domains, you must set up your analytics to reflect that. “ This includes subdomains (e.g. admission.yourcollege.com, blog.yourcollege.com etc.)and even payment gateways that send your visitors away from the website.

Let’s consider the following example:

  • Your college website has an online application form
  • The main college website and the application form are located on two different domains, say www.yourcollege.com and www.yourcollegeadmission.com
  • You want to analyze the relationship between the main college website’s performance and the application form performance, so you implement Google Analytics with the same account ID on both sites

cross-domain-tracking-google-analytics

If you don’t implement cross-domain tracking in the above example, Google Analytics will consider the main college and application form websites as two separate entities because the tracking cookie (first party) that identifies a visitor is not shared between the two sites. You wouldn’t be able to tell which traffic source is actually bringing the application form sign-ups because they would all be considered as referral traffic.

Tracking Across Domains:

In order to enable cross-domain tracking, you need to share first-party cookie information across domains. Google offers the following methods to enable cross-domain tracking:

_setDomainName(): Share cookie information among multiple domains, multiple domains with subdomains, primary domains with its subdomains, and primary domains with its top level domains.

_setAllowLinker(): Share cookie information among multiple domains, multiple domains with sub-domains, and primary domains with its top level domains.

_link(): Share cookie information among multiple domains and multiple domains with multiple subdomains. The _link() method sends cookie information via URL parameters.

_linkBypost(): Share cookie information among multiple domains and multiple domains with multiple subdomains. This method sends information via form action.

 

Cross-domain Tracking code on main college website:

Replace UA-XXXX-Y by your account ID and yourcollege.com by your main college website address. Insert this code in the head section of all the pages of the main website.

Cross-domain Tracking code on application form website:

After setting up the tracking code, you need to set up cross links to pass cookie information.

Setting up the cross link:

If your web traffic always originates on your main college website and then navigates to an application form domain, you need to set up cross links between your main college website and application form website.

For example: If your main college site has a Call-to-Action, say “Online Application,” which sends visitors to an application form page, i.e.

Online Application

Change the hyperlink to:

Online Application

If you pass information between domains using forms, use the  _linkBypost() method instead.

Debugging tracking code:

If you set up a cross-domain tracking code on your college website but aren’t sure whether it’s correctly applied, use the following debugger/extensions to troubleshoot your analytics setup:

Tag Assistant (By Google): This is a Google Chrome extension to troubleshoot installation of various Google tags including Google Analytics, Tag Manager, etc.

Web Analytics Solution Profiler (WASP): This is a specialized tool to perform quality assurance and understand the functionality of analytics tags.

Google Analytics Debugger: This Chrome extension loads the debug version of the analytics JavaScript and displays code execution information, including error messages and warnings, if your tracking code is set up incorrectly.

If properly set up, cross-domain tracking will maintain the desired referral and more detailed session information for visitors. The more granularly you can track visitor information, the better you can learn about their motivations and behaviours to identify opportunities that convert them into leads.