How the autoLink plugin works (analytics.js)
When you add the autoLink plugin to your tag, it automatically loads with your pages and performs a substring match on all your links. It then recognizes any links that include a domain name you’ve specified in your tag. Any traffic that clicks a link to those domains get counted as cross domain traffic.
For example, if you have set up cross domain measurement on example-1.com and example-2.com, the autoLink plugin recognizes links on example-1.com that go to example-2.com. When a user visits a page on example-1.com and clicks a link to example-2.com, the autoLink plugin counts the navigation as cross domain traffic.
It’s possible to have pages that are set up in ways that stop the plugin from working. You should test the plugin on one page before implementing it on your entire site.
To set up the autoLink plugin, you must add the plugin to your tag, define the domains you want to use, and tell each page to allow the plugin to run.
- Cross-Domain measurement - Web measurement (analytics.js developer documentation)
- Cross-domain measurement with Google Tag Manager