How to Set Up Cross Domain Tracking in Google Analytics

Cody Schneider7 min read

Trying to understand a user’s complete journey on your website can get messy when they have to jump between two different domains you own. Without the right setup, Google Analytics sees one user becoming two, breaking your attribution and clouding your data. This tutorial will walk you through exactly how to set up cross-domain tracking in Google Analytics 4 so you can get a clear, unified view of the entire customer journey.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What Exactly Is Cross-Domain Tracking?

Cross-domain tracking allows Google Analytics to see sessions on two related but technically distinct domains as a single session. Normally, when a user moves from website-a.com to website-b.com, GA ends the first session on website-a and starts a completely new one on website-b. The original traffic source (like a Google ad click or organic search) is lost, and the new session on website-b will simply list website-a.com as the referral source.

This creates a huge data accuracy problem. When cross-domain tracking is enabled, a special parameter is added to the URL as the user moves between sites, carrying over the session information so GA sees it as one continuous user journey.

When Do You Need It? Common Scenarios

This isn't just an obscure technical problem, it's a very common situation for modern websites. You’ll likely need cross-domain tracking if:

  • Your shopping cart or checkout process is hosted on a third-party platform (e.g., your marketing site is mybrand.com, but your payment gateway is on secure-checkout-service.com).
  • Your blog, support portal, or booking engine is hosted on a separate domain from your main website (e.g., company.com and companysupport.com).
  • You run a promotion or landing page experience on a dedicated domain that sends users back to your central property to convert (specialdeal.com sends traffic to mainproduct.com).

Note: If you are tracking across subdomains, like blog.website.com and shop.website.com, you don’t need cross-domain tracking. Standard GA4 tracking should handle this automatically since the parent domain (website.com) is the same.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

The Consequences of Ignoring It

If you have a multi-domain journey but no cross-domain tracking, your analytics reports will be misleading. You’ll suffer from:

  • Inflated Session and User Counts: Every person who crosses a domain barrier gets counted as a new user.
  • Broken Conversion Attribution: You'll have no way of knowing which marketing campaign on domain-a.com led to a purchase on domain-b.com. That crucial transaction will be wrongly attributed to "referral" traffic from your own site.
  • Lost User Path Analysis: You won't be able to map out a user’s complete path - from landing on a blog post to making a purchase - because the journey is sliced in two.

How to Set Up Cross-Domain Tracking in GA4

The good news is that GA4 makes this process much simpler than its predecessor, Universal Analytics. The main configuration now happens directly within the Google Analytics interface. We recommend using Google Tag Manager (GTM) to deploy the GA4 tag across both of your websites to ensure consistency, but the cross-domain setup itself is mostly a point-and-click affair.

Before you begin, make sure you have Admin access to your GA4 property and understand how the Google tag is implemented on both domains.

Step 1: Configure Your Domains in the Data Stream

First, you need to tell GA4 which domains belong together. This is where you list all of the domains you want to include in your cross-domain measurement.

  1. Navigate to the Admin section of GA4 (click the gear icon in the bottom-left corner).
  2. In the Property column, click on Data Streams and select the relevant web data stream.
  3. Under the Google tag section at the bottom, click Configure tag settings.
  4. On the next screen, under the Settings section, click on Configure your domains.
  5. Now, let’s add the rules. Click Add condition.
  6. You can choose different match types, but "contains" is often the most flexible and reliable. Enter the first domain, for example, mybrand.com.
  7. Click Add condition again and add your second domain, like secure-checkout.com. Add as many conditions as you have domains you need to link.
  8. Once all domains are listed, click Save in the top-right corner.

Executing this step gives your Google tag a friendly heads-up to automatically append a linker parameter to any URLs that point from one of your configured domains to another. This is the mechanism that "links" the sessions.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 2: Add Your Domains to the "Unwanted Referrals" List

Next, you must prevent "self-referrals." This happens when your own domain shows up in your traffic reports as a referral source. Completing this step tells GA4, "Hey, if a user arrives from this domain, don’t treat it as external referral traffic, they're already part of our ecosystem."

  1. From the Configure tag settings screen again, look under the Settings menu and click Show more if needed.
  2. Click on List unwanted referrals.
  3. Under Match type, select Referral domain contains.
  4. In the Domain field, enter your first domain (e.g., mybrand.com) and press Enter.
  5. Then, add another condition for your second domain (e.g., secure-checkout.com). Continue for all domains you listed in the previous step.
  6. Click Save when you're done.

This step ensures clean attribution. Without it, you might still see traffic from mybrand.com being incorrectly credited with conversions on secure-checkout.com.

How to Test If Cross-Domain Tracking is Working

Never assume your setup is perfect without verification. A few minutes of testing now can save you weeks of collecting bad data. Here are the best ways to check your work.

Method 1: Check for the _gl Linker Parameter

The simplest test is to see the linking in action. The cross-domain linker works by adding a parameter (_gl) to the URL of the destination page.

  1. Open a new browser tab.
  2. Go to your primary domain (e.g., https://mybrand.com).
  3. Click a link on that site that leads to your secondary domain (e.g., a "Buy Now" button that goes to https://secure-checkout.com).
  4. Look at the URL in your browser's address bar once the new page loads.

If your setup is working, the URL will look something like this: https://secure-checkout.com/?_gl=1*abcde*...

If you see that _gl parameter, congratulations! The two domains are talking to each other correctly. If you don't see it, go back and double-check your domain configuration in GA4.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 2: Use GA4's DebugView for Precise Testing

DebugView is a powerful tool for seeing exactly what data GA is receiving in real-time. It’s perfect for confirming that session information is being carried over smoothly.

  1. Install the official Google Analytics Debugger extension for Chrome.
  2. Click the extension's icon in your toolbar to turn it on for your site (it will show an "ON" badge).
  3. In another tab, go to your GA4 property and navigate to Admin > DebugView (under Data display).
  4. Now, perform the user journey on your website. Start on your first domain and then click a link to navigate to your second domain.
  5. Watch the events as they appear in DebugView.

You’re looking for two key indicators: First, you should see page_view events appear for both domains in the same timeline. Second, click on a page_view event after crossing the domain and look at the ga_session_id parameter. This number should be identical to the session ID from before you crossed domains. If it stays the same, GA is correctly viewing it as one single session!

Troubleshooting Common Issues

Didn't work on the first try? Don't worry. Here are some of the most common hiccups and how to fix them.

  • The _gl parameter is not being added to the URL.
  • Self-referrals are still showing up in my reports.

Final Thoughts

Properly setting up cross-domain tracking in GA4 transforms your messy, fragmented data into a single, cohesive story of your user's journey. By configuring your data stream so that all your domains are listed and those same domains are correctly excluded as referrals, you can finally gain an accurate understanding of which marketing efforts are truly driving results.

Of course, getting your attribution straight in GA4 is only the first step. The real goal is to see how those analytics fit with performance data from your ad platforms, sales from your CRM, and revenue from your e-commerce store. At Graphed, we automate that entire cross-platform reporting process. You simply connect your sources - like Google Analytics, Facebook Ads, Shopify, and Salesforce - and then ask questions in plain English to build real-time "cockpit" dashboards. This gives you back the hours you'd otherwise spend manually stitching together disconnected reports, letting you move straight to insight.

Related Articles