Cross-Domain Tracking in Google Analytics 4

Learn how to seamlessly track users across multiple domains with Google Analytics 4. Discover step-by-step setup instructions, practical tips, and solutions to common issues to ensure your data stays accurate and actionable.

Cross-domain tracking in Google Analytics 4 (GA4) helps you track users across multiple related domains as if they were visiting a single site. Without it, data from different domains gets fragmented, leading to incomplete insights. In this guide, we’ll cover everything you need to know to set up and optimize cross-domain tracking effectively.

What Is Cross-Domain Tracking?

Definition of Cross-Domain Tracking

Cross-domain tracking is a method in GA4 that lets you track user behavior across multiple domains. It ensures that actions like clicks, page views, and conversions are linked to a single user journey instead of treating each domain separately.

For example, if a user starts browsing on example1.com and completes a purchase on example2.com, cross-domain tracking ensures this is recorded as one session instead of two.

Why Cross-Domain Tracking Is Important

When multiple domains are involved in your business, cross-domain tracking is vital for:

  • Accurate Metrics: It prevents overcounting users and ensures data integrity.
  • User Journey Insights: Understand how users navigate between domains.
  • Conversion Analysis: Tie conversions back to their original traffic source for better attribution.

If you don’t enable cross-domain tracking, GA4 treats activity on each domain as separate sessions. This leads to skewed data and a limited understanding of how your website performs.

Setting Up Cross-Domain Tracking in GA4

Setting up cross-domain tracking requires a few steps. Here's a clear and simple guide to help you through the process.

Step 1: Identify Related Domains

Start by listing all domains you want to track together. These are usually the main site and related domains such as:

  • A checkout or payment domain
  • A blog or support portal hosted on another domain
  • Separate product or service sites

For example:

  • www.example.com (main website)
  • store.example.com (online store)
  • www.example-support.com (support portal)

Having this list ready makes the setup process more straightforward.

Step 2: Enable Cross-Domain Tracking in GA4

Configure Domains in GA4

  1. Log in to your GA4 property.
    Open the Admin section of GA4.
  2. Go to Data Streams.
    Under Property Settings, click Data Streams and select your website’s data stream.
  3. Access Tag Settings.
    Scroll to Additional Settings and click Configure Tag Settings.
  4. Add Related Domains.
    Under Configure Your Domains, add all related domains you want to track. Enter the domain names like example.com or example-support.com.

This step ensures GA4 recognizes these domains as connected and tracks user activity seamlessly between them.

Step 3: Configure Google Tag Manager (If Applicable)

If you use Google Tag Manager (GTM) for your analytics setup, you’ll need to configure it for cross-domain tracking.

  1. Open GTM.
    Log in to your GTM account and open the container for your website.
  2. Edit the GA4 Tag.
    Find your GA4 Configuration Tag in the Tags section and open it.
  3. Enable the Linker Feature.
    Under Fields to Set, add a new field:some text
    • Field Name: allowLinker
    • Value: true
  4. Add Cross-Domain Settings.
    Scroll to the Cross-Domain Tracking section and enter the related domains you want to track, separated by commas.

This ensures that cookies and session data are shared between domains, allowing GA4 to track users as they move across your site.

Step 4: Test the Configuration

Test Using GA DebugView

GA4 includes a DebugView feature to help you test whether cross-domain tracking is working.

  1. Trigger Activity Across Domains:
    Open your website and perform actions like clicking links that navigate between domains.
  2. Check DebugView:
    In GA4, go to Admin > DebugView to see if events are being tracked across domains as part of a single session.

Inspect Cookies in the Browser

You can also use browser developer tools to check the _ga cookie.

  • Open Developer Tools in your browser.
  • Check the cookies for each domain and ensure they share the same _ga value.

If the _ga value changes between domains, there may be an issue with your configuration.

Common Issues and How to Fix Them

Cross-domain tracking can sometimes run into issues. Here are the most common problems and how to resolve them.

Problem 1: Sessions Break Across Domains

What Happens: Users moving between domains are tracked as new visitors, leading to inflated user counts and broken sessions.

Solution:

  • Ensure the same GA4 property ID is used for all domains.
  • Double-check that all related domains are listed in the cross-domain tracking configuration.

Problem 2: Self-Referrals in Traffic Sources

What Happens: When users move between domains, GA4 may incorrectly log the originating domain as the referral source instead of the actual source (e.g., Google or an ad campaign).

Solution:

  • Add your domains to the Referral Exclusion List in GA4.some text
    1. Go to Admin > Data Settings > Traffic Settings.
    2. Add your domains to the referral exclusion list.

This prevents GA4 from treating traffic from one of your domains as a referral.

Problem 3: Incorrect GTM Settings

What Happens: If you use GTM but don’t configure it correctly, cross-domain tracking may not work.

Solution:

  • Ensure the allowLinker field is set to true in your GTM tag.
  • Verify the domain names in the Cross-Domain Tracking settings match exactly with the domains you’re using.

Best Practices for Cross-Domain Tracking

Here are some tips to ensure cross-domain tracking works smoothly:

1. Regularly Update Domain Settings

Whenever you add a new domain, ensure it’s included in the allow list in both GA4 and GTM. Missing domains can cause sessions to break.

2. Test After Making Changes

Always test your configuration using GA DebugView and browser tools after making updates. This ensures that tracking works as expected and prevents data issues.

3. Use UTM Parameters for External Campaigns

For traffic coming from external sources (e.g., ads or social media), use UTM parameters in your URLs. These help you identify the original traffic source, even when users move across domains.

By following these steps and best practices, you can ensure that cross-domain tracking in GA4 is set up properly, providing accurate data and actionable insights.

FAQ

What is cross-domain tracking in GA4?
Cross-domain tracking lets you track user activity across multiple related domains as a single session. It ensures data accuracy and connects the entire user journey.

How do I test if cross-domain tracking is working?
Use GA4 DebugView to monitor user activity across domains. Check browser cookies to ensure the _ga value remains consistent between domains.

Can I set up cross-domain tracking without Google Tag Manager?
Yes, you can configure cross-domain tracking directly in GA4 by adding related domains in the Data Streams settings. GTM is optional but simplifies the process.

Conclusion

Cross-domain tracking in Google Analytics 4 is essential for businesses managing multiple domains. By connecting user activity across domains, it provides accurate insights into user behavior, traffic sources, and conversions. Setting it up requires proper configuration in GA4 and, if applicable, Google Tag Manager, followed by thorough testing to ensure data integrity. With cross-domain tracking in place, you’ll gain a complete view of your audience, enabling better decision-making and performance optimization.

Related Posts

Outdated data warehouses slow down queries, limit storage, and hinder integration, security, and analytics, impacting business efficiency and growth. Upgrading to modern, scalable platforms improves performance, security, and insights for better decision-making.
Discover actionable strategies to cut data warehouse costs without sacrificing performance. Learn how to optimize storage, streamline queries, and manage resources effectively. Start saving today with these practical, proven techniques!
Understanding the services supported by server-side tagging not only maximizes its benefits but also empowers you to take control of your digital marketing strategies.

Schedule an initial consultation now

Let's talk about how we can optimize your business with Composable Commerce, Artificial Intelligence, Machine Learning, Data Science ,and Data Engineering.