Google Analytics

GA4 Guide: Cross-Domain Tracking

Taking the Next Step to Improve Your Marketing Strategy + Learning How to Configure Cross Domain Tracking in Google Analytics 4

Main Image Courtesy of SEO Setups.

Cross-domain tracking has not always been an easy process, particularly in the older versions of Google Analytics where the configuration had to be done on the code level or Google Tag Manager (GTM). Thanks to GA4, the latest Google Analytics update, the process is much simpler and no intricate tagging is involved. 

Cross-Domain Tracking Overview + GA4

When a user goes from one domain to another in GA4, the session and client identifiers are preserved. This is where the term "cross- domain tracking" comes from.

GA4 uses cross-domain tracking to maintain the identity of a user across different domains. This method ensures that all of their activities are linked to the same person, which helps businesses improve their customer experience and understand their behavior. Through this data, businesses can formulate marketing strategies that are based on precise information.

The cross-domain tracking process adds a parameter to the URL of all outbound links from a given domain to another one. The client and session identifiers are saved as first-party cookies on the receiving domain, and this method ensures that the same information is kept for each domain that's visited.

First-party cookies are used by Google Analytics to collect information about a user's activities on a website. When a user visits a website, Google Analytics will store a cookie called _ga in their browser's memory. This cookie will be used to analyze the user's behavior as they navigate from one page to another.

Since the cookie is already present, Google Analytics will know that the user is the same person who accessed the first page of the site. This means that the second page of the site will also be saved as part of the user's session.

Setting Up Cross-Domain Tracking 

To start off the cross-domain tracking process, you should first ensure that all domains that are part of cross-domain monitoring have the same measurement ID. This will allow you to track all of them and collect the same data. Cross-domain monitoring only works if all of them have the same stream of information.

In the Data Stream section of Google Analytics, click on the "More Tagging Settings" option. You'll then be able to configure the domains that are part of cross-domain monitoring.

The new GA4 structure features data streams. With Universal Analytics, you can set up unique properties for your various sources of data, such as your website, apps for iOS and Android, and your data collection. You can also customize reports and workflows using filters and views.

With the new GA4 structure, views have been replaced by data streams. Now, you have a single property that contains all of your data sources, including your website, apps for Android and iOS, and your data collection. You can use filters to customize the way you view and track your data. 

If you haven’t done so already, start collecting data for your web page or app today through GA4! Image Courtesy of Facebook

To test the process thus far, go to one of the domains that you've been collecting data from and click on the link that will take you to another domain. The goal of the following testing is to ensure that the traffic that you're receiving from the target domain and the source domain have the same identifiers.

A new URL parameter should pop up with _gI and a bunch of hash values. Each of the values is prefixed with a cookie name. The _gl parameter might not be present in the URL, however, which means that you've either changed the name of the domain in the cross-site tracking settings or that there's something wrong with the link decoration.

The last thing you need to do is compare the cookie set for the source and target domains. If you've got all the necessary technologies running on both domains, you should be able to see the matching values in the cookies.

If you're using a Google Analytics 4 configuration that's running on the target domain and collecting the same data streams as the source domain, the _ga and -ga_XXXXXX values should be identical.

If you're a Google Tag Manager user who's using a server-side container, and you're also collecting the same data from the same account, you should see the matching .fplc cookie values. If you're running a Google Ads conversion feature on the target domain's website, you should see a similar _gcl-aw cookie set with a click identifier as the version set on the source site.

Configure Cross-Domain Tracking Manually

Sometimes you can run into issues when you try to configure cross-domain automatically, so you can always attempt the process manually and have even more control when it comes to setting everything up. 

The manual process can be a bit more challenging and time-consuming, since there is no built-in method in Google Tag Manager or gtag.js that allows you to generate the _gl parameter manually. Instead, you need to manually add the linker parameters to the outbound links and then grab them from the site.

If you’re not scared away already, check out these following steps when it comes to cross-domain manual tracking:

  1. To implement this process, you need to create an event listener on the source site that will listen in on all the link clicks that are relevant to the specified domains.
  2. If an event occurs, the listener callback should not direct the event to the next action.
  3. First-party cookie values must be extracted from the target page and append them to the link URL's query parameters.
  4. In addition to the first-party cookie values, you also need to add the current timestamp of the link to the query parameters. The target URL should be loaded with the associated query parameters.
  5. Make sure that the target page's timestamp is less than one minute old and that the browser is compatible with the current version.
  6. Before you start implementing this process, you need to run a script that will extract the values from the target URL and then store them in first-party cookies.

Problems to Look Out For

Cross-domain tracking issues can cause data from other channels to appear deflated or to be inflated. In most cases, this occurs when the user hops around from one site to another, which causes duplicated and registered data to be transferred as direct traffic.

One of the biggest issues that cross-domain tracking can have is the occurrence of the same session twice. This occurs when both the first and second session are referred from the same source. Multi-domain tracking strategies can also lead to inaccurate sessions if they do not utilize referral exclusions.

When tracking cross-site traffic using Google Analytics, it's important to ensure that both the domains are using the same property. Each of the properties has its own unique table of data, ID, and tracking configuration. It's also important to note that client IDs are not shared between the two sites.

The client ID of a domain doesn't track the link parameters between that domain and another. Cross-domain tracking can be performed by simply adding the GA parameter in the source page's URL. This ensures that the user who is visiting the other site is the same one who is navigating the session.

When trying to implement cross-site tracking, make sure that your website does not automatically remove the GA parameter. You might need to work with your development team on this issue.

The final issue you may run into are the "allowLinker" or "auto link domains" values in Google Analytics not being properly configured. This means that any associated target domains should be set up to allow cross-site tracking.

Once the allowLinker field is set up, you can easily cross-domain tracking for the domains needed. Image Courtesy of Absent Data

Double Check the Accuracy

There are a couple of simple steps that you can take to confirm that your cross-domain tracking system is working properly.

One of the easiest ways to confirm that Google Tag Manager is working properly is to use a tool known as Tag Assistant. This is a tool that can help you keep track of your activities across multiple domains. It can also tell you if the session that crossed the domains worked or not.

One of the most useful tools that you can use to check the status of your cross-site tracking is Google Analytics. This can help you determine if the activity that crossed the domains was successful. This may not be ideal for sites with a lot of traffic but it is a good solution for most.

From organic search, go to your site and click on the "Real-Time Report" button. To see the locations of your website, click on the "Locations" button and select the city where you are located. Cross-linking from the source domain will allow you to visit the target one while watching in real-time.

If you're experiencing issues with your cross-site tracking system, it's likely that you have a problem with your medium moving from organic to direct. One of the easiest ways to confirm that a problem is happening is to use a tool known as WASP.inspector. This Chrome extension can help you view and record the various numbers associated with your website's visitor ID and GA cookie.

Easily add the WASP.inspector extension to your Google Chrome today. Image Courtesy of the Chrome Web Store

After you've cross-linked from the source domain to the target site, make sure that the string of digits in your cookie ID matches the original. This can help you determine if there's a problem with your system and allow you to fix it.

Quality Assurance 

Cross-domain quality assurance can be carried out using Google Analytics or Google Tag Manager. This process can be somewhat invasive, but it can be simplified by following these steps.

To identify cross-domain links, go through your site and make sure that all of them are properly decorated. Also, make sure that the "allowLinker" setting is set to true. In addition, make sure that the property ID of the links is the same as the one for the target and source domains. 

Finally, ensure that there are no attempts to trigger new sessions by visiting both domains. Cross-site quality assurance issues can be encountered differently on different websites and situations. 

Configure Cross-Domain Tracking with GA4 Today and Take Your Business to the Next Level

GA4 is more flexible than Universal Analytics, allowing you to track cross-domain activities without requiring additional configuration. It also eliminates the need for Auto Link Domains and Linker. Overall, cross-domain tracking can help people make informed decisions and improve the overall efficiency of their operations.

The latest version of Google Analytics 4 has a clear direction: less configuration is required in the code and more in the interface itself. 

Get great insight from our expert team.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
By signing up you agree to our Terms & Conditions