Cross-Domain Tracking on GA4(2025)

Google Analytics BCS 6 years ago (2019-11-18) 2830 Views 0 Comments

Update time: June 10, 2025

In this section,  I will talk about how to do Cross-Domain Tracking in Google Analytics 4.

Cross-domain tracking in Google Analytics 4 (GA4) is a powerful feature that allows businesses to track user behavior across multiple domains as a single, cohesive session. This is essential for websites that span multiple domains, such as a main site (a.com) and an external checkout page (B.com). When implemented correctly, cross-domain tracking ensures accurate user journeys, attribution, and metrics in GA4. However, misconfigurations or technical issues can lead to tracking failures, resulting in fragmented sessions, inflated user counts, or inaccurate data. This article explains how cross-domain tracking works in GA4, key parameters involved, common reasons for failures, and best practices for successful implementation.

How Cross-Domain Tracking Works in GA4

Cross-domain tracking enables GA4 to treat user interactions across multiple domains as part of the same session. For example, if a user navigates from A.com to B.com, GA4 uses specific parameters and cookies to maintain session continuity and attribute actions to the same user. This is achieved through the following mechanisms:

  • Linker Parameter (_gl): The _gl parameter is appended to URLs when a user navigates between domains. It encodes session and user data, such as the client ID and session ID, to ensure GA4 recognizes the journey as continuous. Example: https://B.com?_gl=1*1gske1c*….
  • Client ID (_ga): Stored in the _ga cookie, the client ID uniquely identifies a user’s device or browser. It is passed across domains to maintain user-level tracking. Example: _ga=GA1.2.123456789.1234567890.
  • Session ID: This tracks a user’s session and is shared across domains to prevent GA4 from creating new sessions on each domain.
  • Measurement ID-Specific Parameter (e.g., _ga_HZ4RDGTX66): This parameter ties session data to a specific GA4 property and includes details like session start timestamps.

To enable cross-domain tracking, you must configure GA4 to recognize the involved domains and append the linker parameter to URLs. This can be done via the GA4 interface.

Configuration Cross-Domain Tracking on GA4

Configure GTM

A GTM container is installed on each website and sends data to the same GA4 Property.

 

 

Configure GA4

InWeb stream details,click「Configure tag settings」——「Cross-domain Linking Configuration」, add both domain names:

That’s it, it’s set up, very simple.

Test

On website A.com, click any link that can jump to website B, and you will see a special string on the URL of website B.

https://B.com&_gl=1*1gske1c*_gcl_au*MTExMTEwOTU5MS4xNzQ4MzA2ODk3*_ga*Njk4MzAyOTIwLjE3NDgzMDY4OTg.*_ga_HZ4RDGTX66*czE3NDk1MTkyODQkbzQwJGcwJHQxNzQ5NTE5Mjg0JGo2MCRsMCRoMjQzMzcyODg1
  • _gl:
    • Value: 1*1gske1c
    • Purpose: This is the linker parameter used in Google Analytics 4 (GA4) for cross-domain tracking.
    • Explanation: The _gl parameter encodes session and user information (e.g., client ID, session ID) to ensure that user activity is tracked as a single session across multiple domains. The value 1*1gske1c is an encoded string that GA4 uses to maintain session continuity when a user navigates from one domain to another (e.g., from A.com to B.com). It helps GA4 recognize that the user’s journey continues on the new domain without starting a new session.
  • _gcl_au:
    • Value: MTExMTEwOTU5MS4xNzQ4MzA2ODk3
    • Purpose: This is the Google Ads conversion linker parameter.
    • Explanation: The _gcl_au parameter is used for tracking ad interactions, particularly for Google Ads conversion tracking. The value MTExMTEwOTU5MS4xNzQ4MzA2ODk3 (base64-encoded) typically includes a timestamp and a unique identifier to attribute ad clicks or impressions to conversions. It helps link user actions (e.g., clicking an ad) to activities on the destination website (B.com). This parameter is not directly related to GA4 cross-domain tracking but is often present in URLs for marketing attribution.
  • _ga:
    • Value: Njk4MzAyOTIwLjE3NDgzMDY4OTg.
    • Purpose: This is the Google Analytics client ID parameter.
    • Explanation: The _ga parameter stores the client ID, which uniquely identifies a user’s device or browser. The value Njk4MzAyOTIwLjE3NDgzMDY4OTg. (base64-encoded) typically follows the format GA1.2.randomNumber.timestamp, where the random number and timestamp help GA4 track user interactions over time. In cross-domain tracking, this parameter ensures that the same user is recognized across domains, maintaining continuity in user-level reporting.
  • _ga_HZ4RDGTX66:
    • Value: czE3NDk1MTkyODQkbzQwJGcwJHQxNzQ5NTE5Mjg0JGo2MCRsMCRoMjQzMzcyODg1
    • Purpose: This is a GA4 session-specific parameter tied to the measurement ID.
    • Explanation: The _ga_HZ4RDGTX66 parameter is associated with a specific GA4 property (identified by the measurement ID, e.g., G-HZ4RDGTX66). The value czE3NDk1MTkyODQkbzQwJGcwJHQxNzQ5NTE5Mjg0JGo2MCRsMCRoMjQzMzcyODg1 is an encoded string that includes session-related data, such as the session ID, session start timestamp, and other tracking details. This parameter helps GA4 maintain session consistency across domains and track session-level metrics like page views and events.

At the same time, you can also look at the Cookie _ga of A.com and B.com. Its should be the same to achieve cross-site tracking and identification as the same user.

Common Reasons for Cross-Domain Tracking Failures

  • URL redirects:If the destination page redirects or doesn’t support arbitrary query parameters, the parameter _gl may end up being removed from the URL even if it was appended by Analytics in the previous page.
  • Conflicts with other scripts:Cross-domain measurement works by creating an event listener on the document node of a page. When users click a link, the click event bubbles up to the document node and the parameter _gl is added to the link URL. 
  • Incorrect Configuration of Linker Domains:  For example, you need to configure both A.com and B.com to Cross-domain Linking Configuration, but you only configured one.
  • Blocked Cookies or Tracking Restrictions:Browser settings, ad blockers, or privacy extensions (e.g., Safari’s Intelligent Tracking Prevention) block cookies or tracking parameters.

If you don't understand, You can leave a comment below.
Like (1)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website