Cross Domain Tracking makes it possible for Google Analytics (GA) to connect sessions on two related sites and make it a single session. This continuous flow allows you to understand how users navigate through your web properties to provide insight on a complete user journey. Without this in place, there is no way for you to properly track site visitors without interruption, and you will experience falsely inflated sessions.
Cross Domain Tracking should be considered if you have:
- A checkout process with a 3rd party shopping cart that takes place on a separate domain.
- Multiple locations and each location has a separate website.
- A blog that resides on a subdomain or a different URL.
- Content that displays on another domain through an iFrame.
To implement Cross Domain Tracking, it’s most effective to work within Google Tag Manager (GTM). Once logged into your GTM account, click on Variables in the left hand menu and then New. This will create a new Variable.
It is here where you will create a Cross-Domain Variable. As a best practice, always name your Variable first.
Next, you will choose a Variable type to set-up. The Variable type being used is located under Utilities and is the Constant Variable type.
Now insert the two domains you want to set-up with Cross Domain Tracking. This is placed into the Value section of the Variable being created. Please note, you must separate the domains with a comma.
Hit Save in the upper right hand corner.
Once saved, we are going to edit your GA-Pageview tag or Universal Analytics tag. Click on Tags in the left-hand menu and select your GA-Pageview tag.
After the tag opens, click on Advanced Configuration.
Next, click on More Settings and then Fields to Set.
In the Field Name enter in allowLinker and set the Value to “true”, as shown above. This instructs Analytics to check for a linker parameter and sets the true value of a domain to pass or accept the cookie information.
Next, we are going to add another Field. This Field name will be cookieDomain and its value will be “auto”. This directs Google Analytics to continue the session from the starting session cookie.
On this same screen, scroll down to Cross Domain Tracking. This is where you will insert the name of the variable we created under the Auto Link Domains.
Press Save. You are now ready to publish your tag. MoreVisibility suggests you test each of these tags to ensure the tracking is properly established.