Digital Marketing
How to Set-up Cross-Domain Tracking with Google Analytics 4
Feb 5, 2025
Tracking user behavior across multiple domains can be a challenge. Without accurate cross-domain tracking, your data may be fragmented, leading to incomplete insights and potentially misguided decisions. Google Analytics 4 (GA4) offers powerful tools to unify data across different domains, helping you understand how users interact with your business comprehensively.
In this guide, we’ll walk you through the steps to set up cross-domain tracking using Google Analytics 4, discuss why it's crucial, and share best practices to ensure you're capturing accurate data across all your domains.
Why Cross-Domain Tracking is Essential
Cross-domain tracking allows you to monitor user interactions seamlessly across multiple domains. This is particularly important for businesses with several websites or domains, such as:
● E-commerce Sites: Where different domains may be used for the main store, blog, or customer support.
● Marketing Campaigns: Where landing pages and promotional content are hosted on separate domains.
● Multi-Brand Organizations: Managing several brands or services under different domains.
Without cross-domain tracking, these interactions would be treated as separate sessions, leading to fragmented data and misleading insights. By unifying this data, you can get a complete view of user behavior and better evaluate your marketing strategies and website performance.
Setting Up Cross-Domain Tracking in Google Analytics 4
Follow these steps to configure cross-domain tracking in Google Analytics 4:
1. Log In to Google Analytics 4
● Access your Google Analytics account and sign in with your credentials.
2. Navigate to Admin Settings
● On the bottom left of the navigation menu, click Admin.
3. Add a New Data Stream
● Click on Data Streams.
● Click Add Stream and select Website.
● Enter your domain details and click Create Stream.
Important: All domains you wish to track should be included in the same data stream. They must use the same measurement ID and tracking code to ensure consistent data collection.
4. Configure Domain Settings
● After adding a data stream, click on it to open its settings.
● Scroll down to Google Tag and click Google tag settings.
● Click Configure your domains.
● Add each domain you want to track by clicking Add condition and entering your domain names. You can add multiple domains here.
Recent Update: Cross-domain tracking is not required for subdomains of the same root domain. For instance, if you have www.example.com, blog.example.com, and support.example.com, you do not need cross-domain tracking. However, it is essential for separate domains like www.mainwebsite.com and support.someotherdomain.com.
5. Save Your Settings
● Ensure you click Save on the top right corner to apply your changes.
Adding Your New Domain to the Referral Exclusion List
To prevent Google Analytics from misinterpreting traffic between your domains as referrals, add your new domain to the referral exclusion list:
In Google Analytics 4, select Admin from the sidebar.
Choose the correct GA4 account and property.
Click Tracking Info and then Referral Exclusion List.
Click +Add Referral Exclusion and enter your new domain.
Click Create.
Your new domain will now appear in the Referral Exclusion List, ensuring accurate data collection.
Verifying Cross-Domain Tracking
To confirm that cross-domain tracking is working correctly, follow these steps:
1. Test the Tracking Setup
● Visit your primary domain (domainA.com) and find a link that directs to your secondary domain (domainB.com).
● Click on the link and check if the URL contains the _gl= parameter, which indicates the cross-domain tracking is active.
2. Use Google Tag Assistant
● Add the Google Tag Assistant Chrome Extension to your browser.
● Refresh your page and click the extension icon to check the property ID.
● Ensure the property ID matches on both domains.
Note: Ensure links open in the same tab for accurate tracking.
3. Check Reports and Alerts
● Open the Google Tag Assistant extension and select Stop Recording. Click Show Full Report.
● Select Google Analytics 4 Report and choose the view you want to test.
● Check the Alerts section for any issues related to cross-domain tracking.
● Scroll to the Flow section and verify that there are page loads from both domains.
4. Use the Inspector Tool
● Right-click on the page and select Inspect to open the Developer Tools.
● In the Network tab, filter for requests containing collect in the header. Check the property ID to ensure it matches.
Best Practices for Cross-Domain Tracking
To ensure you get the most accurate data from your cross-domain tracking setup, follow these best practices:
1. Use Consistent Measurement IDs
Ensure all your domains use the same GA4 measurement ID and tracking code to maintain data consistency.
2. Regularly Review Your Setup
Periodically review your cross-domain tracking setup to ensure it remains accurate as your domains and tracking needs evolve.
3. Validate Your Data
Regularly check your reports and tracking setup to ensure data is being collected correctly across all domains.
4. Educate Your Team
Ensure that all team members responsible for analytics understand the importance of cross-domain tracking and follow best practices.
Conclusion
Cross-domain tracking in Google Analytics 4 is essential for businesses managing multiple websites or domains, ensuring you capture a complete view of user interactions. Without it, data becomes fragmented, leading to inaccurate insights and suboptimal decisions. By setting up cross-domain tracking, you unify data across domains, allowing for more precise analysis of user behavior, marketing efforts, and website performance. Following best practices such as consistent measurement IDs and regular reviews ensures the data remains accurate, providing a solid foundation for data-driven decision-making.