In this post I’ll show you how to implement cross domain tracking in the new version of Google Analytics 4.
With GA4 cross domain tracking is much easier than the Universal Analytics version, in fact:
- in Universal Analytics you had to set everything up within Google Tag Manager
- In Google Analytics 4 you can do everything from the GA Administration panel
If you don’t have already implemented the GA4 Property, I suggest you to read my post where I described how to do that.
How to implement cross-domain tracking in GA4
Let’s go inside the Admin panel at the bottom left
Now click on Data Stream under the Properties column (where you can find the main information related to your GA4 such as the Measurement ID)
Select the Data Stream you are interested in, from the list you see:
Now, scrolling the page, we have to select the More Tagging Settings item:
At this point, select Configure your domains:
Then select the Add condition item:
A series of conditions will appear:
Choose the one you think is most useful for your case and enter the domain you want to be included in the list:
You can add additional domains by clicking on the Add condition item or delete them by clicking on the minus sign “–“
Save and that’s it!
By entering the domains as I did above, for example, ‘example.it‘, this means that all subdomains, which contain the main domain ‘example.it‘ will be included.
To give a concrete example, the subdomain ‘blog.example.it‘ or ‘ga.example.it‘ will be covered by the domain ‘example.it’.
In Google Analytics 4, implementing cross-domain tracking is very quick and easy.
If you have the Universal Analytics version, just copy the domains you have implemented in the tag in GTM and insert them in GA4.
How to implement cross-domain tracking in Universal Analytics
In the Universal Analytics version it is not possible to perform the operation directly from the GA Administrator panel.
You have to implement the Google Analytics variable first.
Subsequently, within the variable you have created, you must click on the Cross Domain Tracking item:
Then, enter the domains inside the box called Auto Link Domains:
Save the variable and publish the changes made.
Cross-domain tracking in Google Analytics 4 and Universal Analytics
If you want to implement the tracking of your website in parallel on both GA4 and Universal Analytics (currently the recommended choice by all experts in the industry), what you have to do is as described in the previous paragraphs.
Within Google Analytics 4 you just need to log into the Administrator panel and implement the solution in a few clicks.
With the Universal Analytics version, implemented with the help of Google Tag Manager, you have to implement the specific variable for GA and take a few more steps.