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.

When a website A drives traffic to a website B, the A website will be called the “Outbound website” and the B “Destination website”. The linker parameter allows the destination page to understand that one person navigates between two websites. You can have four crossdomain scenarios depending on how users navigate between domains and their respective solutions: By clicking on a link > auto link domains feature. By submitting a form > decorate form tag. By navigating on an iframe within the outbound domain > decorate the iFrame’s URL. If none of the previous solutions worked, placing a JavaScript function with the help of a developer could be the solution. To Add the linker parameter for users who land the destination page by clicking on a link navigate to the GTM container of the destination page > Variables > open the Google Analytics Settings variable > More Settings > Cross Domain Tracking, enter the domain name of the destination domain at the “Auto Link Domains” field and save it.

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..