Are you maintaining multiple websites with different domains? What’s more, do the websites form a part of the same user journey? If so, you need to set up Google Analytics 4 – GA4 cross-domain tracking.
We’ll cover some key topics ranging from setting up cross-domain tracking to debugging.
It’s not uncommon for organisations to operate across multiple domains. For instance, some businesses display products on their main site but sell through a third-party platform.
You can track data for multiple domains using GA4 and view that data in your reports. However, it doesn’t allow you to view continuous sessions as users traverse between domains. In other words, as a user goes to a different domain, the session ends.
This is problematic because you’ll:
Both of which being a problem for budgeting and optimising marketing channels.
GA tracks user interactions using first-party cookies. When a user first comes to your site, they are assigned a cookie with its own identifier.
As you navigate across the site, GA can keep tracking you thanks to the identifier. But as soon as a user changes domains (even if a website is owned by the same company) the cookie stops sending information since Google Analytics can reach only first-party cookies.
To begin, head to your Google Analytics 4 dashboard. You’ll now need to navigate to your admin page at the bottom left of your screen.
From the admin page, select ‘Data Streams’ from the second column.
From here, choose the data stream of your property.
You’ll be presented with a series of options. For now, let’s head to the Google Tag section of the page and choose ‘Configure tag settings’.
Next, select ‘Configure your domains’.
It’s time to choose all the domains that you want to track. Keep hitting ‘add condition’ until you’ve added all the domains you need.
And there you have it! You should start receiving data from all your domains.
If you’ve got a property set up with both GA4 and UA, your cross-domain setup must be identical in both versions. Both UA and GA4 use the same tracking cookie and need uniform settings for cross-domain tracking.
If this is the case, you’ll need to configure a list of domains for cross-domain measurement as explained in steps 5 and 6.
Remember: Any domains that you enter into this page will also impact enhanced measurement. These domains will no longer be classed as outbound links.
To test your cross-domain setup, you’ll need to undergo a debugging process.
There are a couple of ways that you can do this. Let’s look at these different methods.
Once you’ve finished setting up cross-domain tracking, you’ll need to wait around five minutes.
With that done, you can head to your first website. Find an outbound link to your second domain and click it.
From your second domain, take a look at the URL. If you notice ‘_gl’ then your GL parameter has been added successfully. Good news, data from both domains should start entering your reports!
GA4 has a native DebugView within the interface now which is great for any sort of debugging.
To use the Google Analytics DebugView without any hassle, you can install the Google Analytics Debugger chrome extension. Once installed, head to the “Admin” section on the bottom-left of your google analytics account and click the “DebugView” option from under the Property column.
Right now your report will probably be looking pretty empty. If you head to your primary domain, though, this should change. You’ll see a page_view event pop up.
If you’re not getting any event data through, there might be a problem with your setup. Head to the section below to see how you can fix your DebugView.
Click the page_view event and you’ll get some more information. You need to look specifically at event parameters, namely the ga_session_ID, and page_location. As you can see, in this example image, the ID is ‘1688621951’.
When you cross to your second domain, it’s essential that this ID number remains the same.
Important note: Your ID is unique to you and won’t match the example image.
4. Test your second domain
Now it’s time to test your second domain. Head back to your primary site, find an outbound link, and click it. With that done, head back into DebugView and take a look again. Find your new event, and take a look at the event parameters.
Firstly, is your session ID the same? Secondly, does the page_location match your second domain? If you can answer ‘yes’ to both these questions, you’ve successfully enabled GA4 cross-domain tracking.
There are several explanations if you aren’t getting data from your device in DebugView. Let’s look at some potential problems alongside some solutions.
For events to show up in DebugView, they need to have the Debug mode parameter attached. This is ‘ep.debug_mode’ or ‘dbg’. To ensure this parameter is included, you’ve got several options.
You might not realize it, but you could have installed a browser extension that’s interfering with GA4 tracking. If, for example, you’re using the Google Analytics opt-out extension, all data from your browser will be blocked.
Of course, there are less obvious examples. An ad blocker extension, for instance, could also be the culprit. It’s worth taking a look at your extensions, and seeing if you can spot a potential issue. You could also disable extensions one by one to identify the problem.
Within GA4, you can filter traffic from internal sources. The ‘internal traffic’ filter will block all data from site admins.
To check if this is enabled head into GA4 admin, scroll down to ‘Data Settings’ and ‘Data Filters’. From here, you’ll be able to see if the internal traffic filter is enabled.
No. GA4 automatically tracks subdomains.
As mentioned, GA4 can be a bit of a learning curve. It’s understandable if you need a little extra help. Luckily MeasureMinds is an expert Google Analytics agency that is on hand to help. We can offer assistance with setting up GA4 and making sure cross-domain tracking is properly activated.
We all know how precious historical data can be. Luckily, as long as you set up cross-domain tracking on an existing GA4 property, you won’t lose data.
If you don’t own a domain, you won’t be able to install any tracking code. The only way you’d be collect data is if you know the owner of the website, and they agree to install the tracking code.
Another method for cross-domain tracking is to use Google Tag Manager. This method involves using GTM and GA in tandem. Using this method, you can get even deeper insights into how users interact on your second domain.
For more information on this method, you can view Google’s guide.