How the autoLink plugin works (analytics.js)

When you add the autoLink plugin to your tracking code, 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 tracking code. Any traffic that clicks a link to those domains get counted as cross domain traffic.

For example, if you have set up cross domain tracking on and, the autoLink plugin recognizes links on that go to When a user visits a page on and clicks a link to, 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 tracking code snippet, define the domains you want to track, and tell each page to allow the plugin to run.

Related resources



Was this article helpful?
How can we improve it?