Chat with us, powered by LiveChat
  1. Home
  2. Embed Interactive Content
  3. Cross-Domain Tracking With Google Analytics

Cross-Domain Tracking With Google Analytics

If you wish to use Google Analytics with embedded interactive content, you might want to enable cross-domain tracking. This feature allows Google Analytics to recognize embedded interactive content traffic as belonging to your host website.

Find guidance below on how to setup your Google Tag Manager Settings, or otherwise Google Analytics Snippet Code, so that cross-domain tracking is enabled. Find also how to enable cross-domain tracking when embedding using our Dot Embed WordPress Plugin, or using our Javascript Embed solution.

REMINDER: remember to also add the tracking code to your Dot page, as described here.

When Using Google Tag Manager

If you are using Google Tag Manager you must first setup a Variable:

  1. Give it a recognizeable name, such as ga_crossdomain
  2. Select Variable Type: Google Analytics Settings
  3. Provide your Google Analytics property ID as tracking ID (e.g. UA-XXXXXX…)
  4. Expand More Settings dropdown
  5. Expand Fields to Set dropdown
  6. Add a field and set Field Name to “allowLinker” and Value to “true” (both without quotes)
  7. Expand Cross Domain Tracking dropdown
  8. Add one or more host domains (comma separated) in the Auto Link Domains field. So if you are embedding interactive content in mycompany.com, simply type mycompany.com on that field.

Once you have created your Google Analytics Settings variable, you can now use it whenever creating Google Analytics tags.

When Using Google Analytics Snippet Code

If you are not using Google Tag Manager, and instead use Google Analytics directly, you must locate the following line in your Google Analytics snippet:

gtag('config', 'UA-XXXXXXXX...')

And modify it as follows:

gtag('config', 'UA-XXXXXXXX...',{ linker: { domains: ['mycompany.com'] }});

Where mycompany.com is substituted with the host domain where you will be embedding the interactive content.

With Dot Embed WordPress Plugin

  1. While editing the project you wish to embed, click Put On Website
  2. Go to the WordPress Plugin tab
  3. Check the Allow Google Analytics cross-domain tracking checkbox
  4. Copy and use the new shortcode provided
  5. Make sure you have followed the steps for When Using Google Tag Manager, or for When Using Google Analytics Snippet Code

With Javascript Embed Solution

  1. While editing the project you wish to embed, click Put On Website
  2. Go to the Javascript tab
  3. Check the Allow Google Analytics cross-domain tracking checkbox
  4. Copy the two code snippets given and paste them on your website wherever you wish to load interactive content. The first snippet must only be included once per page. The second snippet may be included multiple times for different pages.
  5. Make sure you have followed the steps for When Using Google Tag Manager, or for When Using Google Analytics Snippet Code

Referral Exclusion On Google Analytics

In order for your traffic to not appear as referral traffic, and to not have the session count doubled, you should add the dot.vu domain to your Referral Exclusions list, as explained in this article from Google’s Support:

https://support.google.com/analytics/answer/2795830?hl=en

Setup Tracking With External Analytics

Updated on February 12, 2019

Was this article helpful?