If you wish to use Google Analytics with standalone interactive content – i.e. not embedded – which will be on a separate domain than your main domain, you want to enable cross-domain tracking if you wish to have seamless analytics.
Find guidance below on how to setup your Google Tag Manager Settings, or the Google Analytics Addon, so that cross-domain tracking is enabled.
REMINDER: remember to also enable Google Analytics or Google Tag Manager on your project.
When Using Google Tag Manager Addon
To enable cross-domain tracking when using Google Tag Manager Addon you must first setup a Variable:
- Give it a recognizable name, such as ga_crossdomain
- Select Variable Type: Google Analytics Settings
- Provide your Google Analytics property ID as tracking ID (e.g. UA-XXXXXX…)
- Expand More Settings dropdown
- Expand Fields to Set dropdown
- Add a field and set Field Name to “allowLinker” and Value to “true” (both without quotes)
- Expand Cross Domain Tracking dropdown
- Add one or more host domains (comma separated) in the Auto Link Domains field.
Once you have created your Google Analytics Settings variable, you can now use it whenever creating Google Analytics tags.
When Using Google Analytics Addon
To enable cross-domain tracking when using Google Analytics Addon:
- In the Editor, go to your Google Analytics Addon setting
- Locate the Seamless Tracking when Not Embedding setting
- Add the host domain or domains (comma separated) where the experience will be linked.
- Save and close