Cross-Domain Tracking in Google Analytics 4

Accurately tracking your user’s journey is the most important part of data collection in Google Analytics. But if you have multiple domains, your data can easily get inflated—that is, until you set up cross-domain tracking.

So what is cross-domain tracking in Google Analytics 4?

Cross-domain tracking is a workaround that allows you to track a user as they move across multiple domains. With cross-domain tracking, Analytics can send identifiers from one site to another, effectively tracking your user as the same person on each site.

Today, we’re going to explain why you need to set up cross-domain tracking if you have multiple websites for your business and how to do it. Luckily, cross-domain tracking is very easy in Google Analytics 4, so come with us to learn about how to get it configured.

What is Cross-Domain Tracking?

Okay, so first, let’s clarify exactly what cross-domain tracking is, and then we can move on to why you want to set it up.

To put it simply, cross-domain tracking is the process of following a user across multiple websites with the same Google Analytics code. For example, you might have a website set up for your general business and one for your online store. It makes sense that you’d want to follow a user between these two sites to get a full picture of their journey and see the behavior that led to a purchase.

But by default, Analytics will not track your users as they move from site A to site B. Instead, you have to set up cross-domain tracking to follow them from one website to another.

Cross-domain tracking is important because it lets you accurately track your users without augmenting your metrics. We’ll discuss this and why you’ll want to configure it in the next section. Then, we’ll show you how to set up cross-domain tracking in your Google Analytics 4 property.

In Universal Analytics, configuring cross-domain tracking was a bit of a headache, but luckily, Google has simplified the whole process in GA4. You’ll find the process pretty straightforward now, so keep reading to learn how to get started.

Why Do I Need Cross-Domain Tracking?

If you have multiple websites, setting up cross-domain tracking is an important step in configuring your Analytics property. Let’s explain why it’s necessary, and then we’ll show you how to do it.

Okay, so the question remains: Why can’t your user be tracked automatically when moving between sites? Well, the issue is that Google Analytics tracks your users with first-party cookies. When a user lands on your site, the site stores a cookie (if the user has agreed to them) that contains their identifier.

But these cookies cannot follow a user from one website to the next, so if the user moves from one of your websites to the other, Analytics will record them as two separate users by default.

This is a big issue for your data collection and can seriously mess up your metrics. That’s because Analytics will track the same user as two separate people across multiple websites, making it seem like you have more users than you really do (pageviews will remain the same). Plus, this will mess up your traffic acquisition reports even further because when a user moves from site A to site B, they’ll be recorded as a “self-referral.”

So what’s the solution? Setting up cross-domain tracking of course! This will allow Analytics to pass cookies between your two sites and give you an accurate view of their journey. So let’s talk about how to do that in the next section.

How to Set Up Cross Domain Tracking in Google Analytics 4

Like we mentioned earlier, cross-domain tracking has been greatly simplified in Google Analytics 4, making it much easier to configure. We’ll talk about that more in a bit, but first, let’s show you how to set up your cross-domain tracking in GA4.

To set up cross-domain tracking in Google Analytics 4, follow these steps:

1. Click on “Admin” in your GA4 property.

2. Under “Property,” click on “Data streams.”

3. Click on your web data stream.

4. Go to “More tagging settings.”

5. Click “Configure your domains.”

6. Click the little pencil icon to enter all the domains you want to configure for cross-domain tracking.

7. Click the “Add condition” button and enter your domains.

8. Click “Save” when you’re ready.

And that’s all there is to it! You’ve now set up cross-domain tracking. Keep in mind that you don’t need to set up any referral exclusions for this to get rid of your self-referring traffic, as Analytics will do this automatically. Also, keep in mind that the cross-domain tracking you set up in GA4 has to match what you may have set up in GA3.

Also, note that your enhanced measurements automatically track your outbound link clicks and this will be affected by configuring cross-domain tracking. All the domains you enter when configuring cross-domain tracking will no longer be treated as outbound clicks. To learn more about enhanced measurements in GA4, check out our previous post here.

Testing Your Configuration

To make sure you’ve properly configured cross-domain tracking, you’ll want to take advantage of your debug view. To get there, click “Configure” > “DebugView.”

Your debug view produces a real-time report you can use for testing. To verify your cross-domain tracking, open up your debug view and then interact with both of your domains from your registered device.

Prior to setting up cross-domain tracking, clicking from one site to the next will trigger GA4 to record an outbound link click (which will be marked just as a “click” in your debug view). You can see this “click” come up if you click the embedded link to move from one of your sites to the next.

Once you set up your cross-domain tracking, though, you will see a couple of things that confirm it’ working properly. First, when you click the link to move from one site to the next, it will no longer record that as an outbound link click in your GA4 debug view. Test this by moving from one site to the next using the embedded link. If you no longer see the “click” in your debug view, that means things are configured properly.

You can also look at the URL as you click from one site to the next to confirm your cross-domain configuration. Once you’ve set up cross-domain tracking, click from one site to the next using your embedded link. Then, look at the URL. If you see the _gl query parameter in the URL, then your cross-domain tracking is working properly.

To learn more about using your debug view, check out our previous post here.

What About Subdomain Tracking?

One question you might have is regarding subdomain tracking and whether you need to set that up as well.

So, do you have to configure subdomain tracking in Google Analytics 4? The answer is no. GA4 will automatically track your users across subdomains, so you don’t need to worry about setting anything up there.

How is GA4 Different And What Are The Benefits?

As we mentioned earlier, cross-domain tracking has been greatly simplified in Google Analytics 4. In Universal Analytics, you had to configure variables in Google Tag Manager and set up your preferences in your GA property. Thankfully, in GA4, all you need to do is enter your domains how we showed above, and you’re all set!

Like most of Google Analytics 4, things are a bit more user-friendly in the new platform. This makes cross-domain tracking easier than ever.

If you want more information on cross-domain tracking in Universal Analytics, check out our previous post here.

Cross-Domain Tracking in GA4

Setting up cross-domain tracking in Google Analytics 4 couldn’t be easier. By simply entering the websites you want to include, you can accurately track your user as the same person when they move between your sites.

Remember this isn’t the same thing as subdomain tracking, which GA4 does automatically for you. Also, remember that you don’t need to set up cross-domain tracking to follow users between your website and mobile apps. Instead, you can simply add them all as data streams within a single GA4 property.

How is cross-domain tracking working for you in the new platform? Let us know!

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons
Scroll to Top