Cross-domain tracking allows users with multiple websites to manage all their websites’ data on a single Google Analytics 4 property.
Multiple websites mean that all websites each have their own domains. So, if you have multiple sub-domains in a single domain, you don’t need to set up cross-domain tracking, because Google can recognize these sub-domains.
- Sub-domains: blog.myshopifywebsite.com, awards.myshopifywebsite.com
- Different domains: myshopifystore.com, myshopifywebsite.com
What are the benefits of cross-domain tracking?
The most beneficial feature of cross-domain tracking is that the customers navigating between your websites have one-single Google identifier (aka. Client Id (cid)).
- The Client ID (cid) is a unique identifier for a browser–device pair that helps Google Analytics to link user actions on a site.
Because the customers have a single Client ID for multiple websites, implementing cross-domain tracking will allow you to get more accurate results in analyses based on the number of users.
- For example: A customer who purchases one of your products from Website1 will be counted as the same user if they will purchase another product from Website2.
How does cross-domain tracking work?
For cross-domain tracking to work, your customers should navigate from Website1 to Website2 via a link or a button to be able to transfer their Client ID to the second website. Once the customers navigate to the second website, Google Analytics stores their Client ID until the cookie expires or the user clears the cookies. This way, the user will continue to be counted as a single user as long as they continue to visit both websites.
What is needed for cross-domain tracking?
Not much! To implement cross-domain tracking on your websites, you’ll only need:
- A link that will redirect users to other websites without leaving your website,
- A Google Analytics account,
- Integration between Google Analytics 4 and both websites.
Note: We will use Google Tag Manager as the integration method. So if you don’t have a Google Tag Manager account yet, you can refer to our open-source GA4 Kit first and complete the setup process for each website.
How to set up cross-domain tracking?
Here are the steps to set up cross-domain tracking in Google Analytics.
You must first decide which Google Analytics property you want to continue with, and then copy the Measurement ID from this property.
Head to Google Analytics 4 > “Admin” > “Data Streams”, select a “Data Stream”, and copy your Measurement ID.
Then, you’ll need to set your Google Analytics 4 Measurement ID in the Google Analytics 4 configuration tag (in GTM) for all the websites.
To do this, open the related tag in Google Tag Manager (001.01 if you have the Analyzify container), enter your Measurement ID, then Save & Publish the containers for all the websites.
Now, go back to your Google Analytics account to configure your domains.
Head to Google Analytics 4 > “Admin” > “Data Streams”, and select the previous data stream. Click “Configure tag settings” > “Configure your domains”, enter your domains, and click Save.
(PS. You can choose the "Match type" depending on your use case, but our recommendation is to use the "Exactly matches" option and enter each domain one by one.)