Easy Google Analytics Cross Domain Tracking with Google Tag Manager

Theo Bennett - January 12, 2016

Back in September, we posted a video where I spoke about the benefits of cross domain tracking in Google Analytics. A few weeks ago, we had a commenter ask this great follow up question:

Thanks for that – Glad it’s easy to do. Instructions for how to do it would be great

This post intends to answer this question by using Google Tag Manager (GTM).

The problem

Your site links to another top level domain where some sort of conversion (sale, registration, etc.) takes place (e.g. A visitor lands on example.com and registers on conversion.com).

Even if you have the same Google Analytics (GA) tracking deployed (discretely or by using GTM), GA won’t share analytics “cross-domain.” Because of this, when you look at all of your GA reports; your conversions will all show as referrals from example.com and the original channel data (organic, email, paid, etc.) will be lost. That makes it very hard to determine which channels, sources, keywords and campaigns are effective!

The solution

By using Cross Domain tracking, a code customization for GA, your site can “pass” the cookie data to the other domain to be shared and your conversion will now be attributed to the proper marketing initiatives.

Step by Step

In GTM, pull up your Google Analytics and select the pencil to configure the tag:

universal analystics

Next, select More Setting >> Fields to Set >> Add Field, then click into Field Name, select “allowLinker,” and type “true” in the value field.

configure tag

Next, select the cross domain section to expand the fields:

cross domain tracking

Once expanded, you can see that there are only three fields and only one that you must add to:

cross domain tracking 2

In the Auto link domains you can either create a new variable that lists the domains that encompass your user’s journey, or just add the domains here comma separated by commas.  Our example would look like this:

auto link domains

Now whenever a link is clicked that leads to “conversion.com,” GA will append the link with information that allows the two sites to share the data (in the same analytics account) between the domains. The link will have a parameter added that looks something like this:


If you have any forms that submit to the third party domain, you’ll also want to toggle the “decorate forms” field to true.

Next: preview, test your site, and publish your GTM container that now contains cross-domain tracking!

Lastly, you will need to go into the Google Analytics Admin settings (you will need “edit” access on the property level to complete this) and select “Referral Exclusion List” and click “Add Referral Exclusion.”

referral exclusion

Add the domains that visitors will traverse on your site:

exclude this domain

That’s it, cross domain tracking in 15 minutes or less!

As always, this customization only allows you to collect better data. Make sure that you allocate resources to analyze the data.

Happy Analyzing!

© 2024 MoreVisibility. All rights reserved.