Google Tag Manager – How to setup Cross Domain Tracking
- Google Tag Manager – Sign up for Google Tag Manager
- Google Analytics – Install Google Analytics if not already in place
- Create Google Universal Analytics Tag – Create a Container in Google Tag Manager with your Google Analytics tracking number
- Auto Link domains – In your Google Analytics container, go to “more Settings > Fields to Set” and set cookieDomains to “auto” and allowLinker to”true”
- Referral exclusions – Add your secondary Domain to the referral Exclusion list in Admin – Property – Tracking Info – Referral Exclusion List
- Test in Real Time
- DataLayer – if you are not seeing any data, it’s time to consider using the Data Layer
Cross Domain Tracking: these very words can send shivers down the spines of even SEO professionals. But there’s no need to fear; this article will discuss how to get Google Analytics data on all your domains into one clean and concise Google Analytics Dashboard by using Google Tag Manager.
This guide is meant to be an accessible introduction to set up of cross domain tracking through Google Tag Manager. Many guides found online are older and show more work than needed. Google augments its products frequently and there have been some changes in how Cross Domain Tracking could be implemented.
What is Cross Domain Tracking?
Cross Domain Tracking is a method of bridging two domains in Google Tag Manager, allowing session data between the two domains to be viewed as one in Universal Analytics.
Who needs cross domain tracking? (or rather, who needs to read this guide?)
In most cases, cross domain tracking is not necessary. Most webmasters run a single site with a single domain, and that site has a clearly defined goal – eCommerce, information, lead generation, or something else. If all your content is housed on a single domain: Rejoice! Google Analytics will take care of many of your data needs, but you can get more robust data if you’d like to implement Google Tag Manager.
If you are an eCommerce site with a domain that handles purchases, or if your content is housed on another domain and visitors go back and forth between the 2 domains, then you are a prime candidate for Cross Domain Tracking in Google Tag Manager.
Using a hypothetical example of a site called SuperWidgets.com, you can explore potential use-cases that could call for cross domain tracking, or a more traditional tracking setup. The flowchart below shows the user’s journey as they go from page to page.
In example 1, the user arrives on the site, clicks around and completes their interaction with the site all on one domain, superwidgets.com.
In example 2, the user arrives on the site and clicks around a little bit. But in step 3, the user has crossed over to another domain, superwidgetsales.com. After making purchases, the user arrives back on the site to the “thank you page” which lives on superwidgets.com.
Looking at these examples – which one resembles the traffic flow on your site? If the user’s journey through your site often results in them interacting on a domain other than your main domain (in these example superwidgets.com), cross domain tracking can help to simplify your analytics data collection and analysis. Whether the site uses eCommerce or not, finding out how users are interacting with our pages is an important step from a user experience standpoint.
Please note the distinction between domains and sub-domains. If your content, checkout page or any other page is hosting on a sub-domain such as research.superwidgets.com then Google Analytics should treat it all as one site, therefore Cross Domain Tracking is not needed.
To implement Cross Domain Tracking, follow this guide. At the end, you should see session data being shared between your two domains under the same Google Analytics account
Step 1: Google Analytics
This guide is going to assume that you have Universal Analytics installed on your site. There are countless guides to assist you with this, but it’s a crucial step in our process today. Please see this guide to learn how to set up Universal Analytics.
It is important you have Universal Analytics installed and have located your UA code, which can be found in ADMIN > Property > Tracking Info > Tracking Code.
Your UA Tracking ID is a series of Characters starting with UA and should resemble this:
Now that you have your UA Tracking Number, you can get started with Tag Manager.
Step 2: Google Tag Manager
Head over to Google Tag Manager and sign up with the same account that you used for Google Analytics. Create an account for your site and save.
Step 3: Create Google Universal Analytics Tag
Navigate to Tags on the left, and hit “NEW” in red.
Name this tag “UA Tag” since it is our Universal Analytics Tag, but name it whatever you’d like that makes it easy to identify as your Universal Analytics Tag. By clicking on Universal Analytics, we are given a Tracking ID field. Please paste your UA Tracking Code here. Make sure that “Page View” is selected.
We aren’t quite done yet, so keep this Tag Configuration menu open.
Step 4: Auto Link Domains
The next step is to link the domains. Go to “more Settings > Fields to Set” and set cookieDomains to “auto” and allowLinker to ”true.” You will need to plug in the two domains you intend to link, separated by a comma. This guide maintains the example above for the text: superwidgets.com & superwidgetsales.com
*Please Note that putting the root domain is preferred. EG: for sales.superwidgets.com, putting superwidgets.com is preferred and is more inclusive than sales.superwidgets.com*
Step 5: Referral Exclusions
Add your secondary Domain to the referral Exclusion list in Admin – Property – Tracking Info – Referral Exclusion List. This is a necessary step since traffic coming from superwidgetsales.com back to superwidgets.com would count as a new session – which, in our example and most Google tag Manager setups, is undesirable.
Congratulations! You have just linked your two domains in Google Tag Manager and you should be able to see traffic flowing back and forth from one domain to the other.
Step 6: Test in Real Time
It’s not enough to set up Cross-Domain Tracking and leave it; always test it to make sure it is behaving as expected.
For this part, it’s best to have a friend on a different device, or to use another browser without being logged into any of your accounts associated with Google Tag Manager and Analytics. On your computer, have Google Analytics open and go to the “Real Time” tab on the left.
Have your friend or your secondary browser opened to your homepage. You should see the session in “Real Time” in Google Analytics. Navigate through the site to your second domain – can you see the “Real Time” data indicate the session has jumped from one domain to the other? Pressing the back button or clicking on a link to the homepage should return the session to the first domain.
Using the previous example: You should see the session start at superwidgets.com and then superwidgetsales.com.
Step 7: Data Layer
We hope that this discussion on Cross Domain Tracking in Google Tag Manager has left you feeling better equipped to explore your analytics data between two domains. If you still have questions, seoWorks is happy to help. Feel free to browse our seo services or contact us.
About seoWorks & Our Best SEO Company Lists
Why We Prepare Our “Best SEO Company” Lists…
For more that 15 years seoWorks was itself a Top SEO Company, providing Custom SEO Services and SEO Packages to clients around the world, from Enterprise Corporations through to Small Businesses…and we did it well.
And at least once a week we heard from a potential client that had a bad experience with an SEO company and either asked us to clean up after the mess, or they were genuinely relieved when we showed them how straight forward and transparent we were in providing our services. In fact, many said we were the best SEO company that they had come across, even before they became a client.
Why did they like us so much?
Well, we are honest, transparent and we documented everything that we promised to do, ticking off what was done, on site and off site. And we delivered results that were measurable, quantifiable and tangible.
So, why did we change?
Simple really. SEO has become a huge business, so we could have continued as a successful premium boutique SEO firm. But, in reality, we simply heard one too many tales of woe from unhappy clients who had unwittingly made the wrong choice before coming to us.
And we decided to do something about it.
To use our 15 plus years of experience and expertise to provide companies such as yours with definitive, independent guides to the Best SEO Company in your city or country. Discover more about how we rank SEO companies and how we deliver Best SEO Company lists that you can trust. And if you still feel that you need advice, explore how we can help you here.