We love digital

Call 0845 485 1219

We love digital - Call and say hello - Mon - Fri, 9am - 5pm

Cross Domain Tracking For Multiple ccTLDs In Google Analytics

Graeme Benge

by Graeme Benge on 20th December 2013

bigstock-Internet-Web-Site-Search-Colla-9198098One of the most useful benefits of Google Analytics is the ability to track a user’s sessions across multiple domains by implementing the Cross Domain Tracking snippet customisation provided by GA.

This customisation passes your user’s cookie from site to site allowing you to ignore self-referrers i.e. having a paid search user from Site A being classed as a referrer on Site B. Instead one user session will be tracked across the two sites as a user that came via paid search.

When Would I Use Cross Domain Tracking To Track Sock Buyers?

Breaking that down to its component parts, my fictitious blog www.ledzepsocks.com may find itself a new visitor from an organic searcher clicking on a post that has ranked well (hooray). Now I may have a limited edition run of highly desirable socks (Shh it could happen). Because I don’t want to spend the time and money on developing eCommerce functionality within my site, I opt to use a third party payment platform such as SagePay, FoxyCart or Shopify. (Fresh Egg produced a useful guide to shopping cart solutions back in May this year.)

Cross Domain Tracking now allows you to join those sessions together as one giving you the ability to understand from start to finish the user behaviour that lead to that conversion.

Our own Gemma put together a video that looked at How To Track Multiple Websites With Google Analytics which you can see below:

This post focuses on another scenario becoming more common that sees companies using multiple country code specific Top Level Domains (ccTLDs). For instance, following the world realising that Led Zeppelin socks are THE thing to own, I might decide to market online internationally with country specific domains and GA codes such as:

  • www.ledzepsocks.co.uk – UA-12345678-2
  • www.ledzepsocks.fr - UA-12345678-3
  • www.ledzepsocks.de - UA-12345678-4
  • In addition to my original domain www.ledzepsocks.com - UA-12345678-1

Tracking International Sock Buying Behaviour

Having found my purpose in life, worldwide domination, one sock at a time seems the next logical step.

Conceivably, a determined sock connoisseur may have stumbled upon one of my sites and found that there is a language variant more suited to their sock chasing needs. Clicking from one ccTLD to another without Cross Domain Tracking would see two user sessions recorded as a new cookie is used for the arrival to the second site.

  • Cookie one would pass Google Analytics the original traffic source of the user
  • Cookie two would pass Google analytics Referral as the traffic source of a new user despite us knowing that it isn’t the case

So a typical scenario may be:

French speaking sock hoarder, big fan of Jimmy Page, lands on www.ledzepsocks.co.uk and then navigates to www.ledzepsocks.fr as the content is presumed to be more meaningful in their native language. 

The Code

The code modifications to achieve cross domain tracking are relatively straight forward.  We need to add two lines to set the domain name and to activate the ‘AllowLinker’ command. These are the lines to use

  • ._setDomainName’, ‘.ledzepsocks.com]);
  • ._setAllowLinker’, true

I’ve used a naming convention of ‘Global’ for my www.ledzepsocks.com – UA-12345678-1 View that is collecting everything. For the international domains I’ve specified ‘Local’ as well as the relevant Google Analytics UA code so that we can ensure that data is passed to the right View.

Adding the ._setDomainName and ._set AllowLinker needs to be done for both Global and Local accounts. Take care to ensure you’ve added the dots highlighted in the image below:

XDT Code

We also need to add an event to the link the users clicks to move from one domain to the other. Typical solutions that solve this for the user tend to involve selecting a country flag or a country name from a drop down menu.

The event would look similar to this:

<a href=” ‘http://www.ledzepsocks.fr’”   onclick=”_gaq.push(['Global._link', http://www.ledzepsocks.fr']); return false;”>Francais</a>

Google Analytics Refinements

It’s all well and good having customised the code and implemented it on my portfolio of high quality classic rock socks. I need to be able to make sense of the data.

In Google Analytics, Views and filters are a powerful way of enhancing your measurement. Best practice here dictates that within your GA account a raw unfiltered and untouched View is a must in case of any data loss on filtered Views.

Another View worth its weight in pixels is one that enhances your content report, taking the URI and appending the Domain to the URI. This way you can compare within the same report how your Home pages or other key landing pages perform across your domains.

To do this, follow the below steps to set up a View with a filter that pulls in the domain as well the URI :

Other Filter

Then the obvious step is to set up a View for the audience targets for each domain. I’m using different domains to target different locations so I only want to pull in data from those locations.

•             www.ledzepsocks.co.uk (UA-12345678-2) for the UK

•             www.ledzepsocks.fr (UA-12345678-3) for France

•             www.ledzepsocks.de (UA-12345678-4) for Germany

To isolate traffic from IP addresses in these locations, within their own Views, I’ve applied an ‘Include’ filter as shown below:

Filter Information

Implementing Cross Domain Tracking with Google Analytics will give site owners optimising in multiple locations a massive leg up in useful data.

Here are some really useful articles worth referring to when carrying out the implementation.

 Image Credit

Internet Web Site Search Collage via Bigstock

Graeme Benge

Graeme Benge

With five years background in Travel, Graeme has built up strong commercial experience alongside online and offline marketing skills working with a variety of Travel Agents and Cruise Specialists. A passionate advocate of SEO and Social Media, Graeme has a strong interest in ROI and analytics in order to deliver the best level of returns.

down arrow

Your Free Whitepaper

The Practical Guide To Google Analytics For Businesses (2nd Edition)

The Practical Guide To Google Analytics For Businesses (2nd Edition)

Download this whitepaper now and get a new one every month!

2 Comments

  • Anna Lewis 30th December 2013

    Nice write up Graeme, love the Ledzep socks example :)

    Combining roll up reporting and cross domain tracking with classic analytics accounts means you need to pay close attention to your code!

    I’m looking forward to more people using Universal Analytics which doesn’t require anything as complicated!

    Reply to this comment

  • Peter Kirwan 3rd February 2014

    Good point about the time of day and ROI regarding roll up. Did a roll up and didn’t think about that but luckily all sites are in the same country!

    Reply to this comment

Subscribe To The Koozai Blog