Implement cross-domain tracking through GTM
1. In GTM navigate to Variables > Google Analytics Settings variable > Add the linker parameter to the destination page (_ga) based on how the user arrives at the destination page.
2. Navigate to Variables > Google Analytics Settings Variable > More Settings > Fields to Set, add a new record name “allowLinker” with true as the value, and click Save to enable the allowLinker field in the GTM container for the destination page.
allowLinker reads the “_ga” parameter coming from the outbound page to assign the same client id value to the destination page.
3. Verify your Google Analytics tracking code is installed on all the websites you want to measure together.
Navigate to Tags > open the Google Analytics pageview tag and make sure it has the Google Analytics Settings variable setup. If you don’t have a pageview tag navigate to Tags > New > create a new pageview tags and select the Google Analytics Settings variable. Navigate to Tags > open the Google Analytics pageview tag and make sure it has the Google Analytics Settings variable setup. If you don’t have a pageview tag navigate to Tags > New > create a new pageview tag and select the Google Analytics Settings variable.
4. Sign in into Google Analytics and navigate to Admin > Tracking Info at the property level > Referral Exclusion List, click + ADD REFERRAL EXCLUSION, add the destination Domain you want to exclude from referral traffic, and click Create.
Referral exclusion helps us consolidate the visited pages within the same session avoiding duplicate sessions and attribution problems.
5. Preview the GTM container with the outbound website > click on the link to the destination website > validate that the destination page includes the “_ga” parameter on the url and the outbound domain doesn’t appear as referral traffic in Google Analytics real-time reports.
If the destination url doesn’t include the _ga parameters go back to step 2 to verify the correct setup. Navigate to Google Analytics Real-Time reports and ensure that the outbound domain doesn’t appear as a referral source of traffic, if it appears as a referral go to Google Analytics and verify all domains are included in the referral exclusion list..