Quantcast
Channel: Why Measure That? » tagging
Viewing all articles
Browse latest Browse all 3

Cross domain tracking with Google Tag Manager

$
0
0

Last year I’ve written a post about how to do cross-domain tracking in Universal Analytics. I am very glad that many readers have given positive feedback on the post and I sincerely hope more people would find it useful. With the introduction of Google Tag Manager (GTM), however, cross domain tracking can be even simpler. In this post I’ll talk about how to implement cross domain tracking with GTM.

What’s cross domain tracking

Again, if you don’t know what it is, I highly recommend you to read my previous post. In short, it’s something that we need to do when we have 2 different top level domains that shared the same Google Analytics tracking code so that we can track users’ journey across the 2 sites holistically.

How to do cross domain tracking in GTM

Let’s reuse the example I’ve made before: actual scenario

abc.com is the shop site and users check out at abccart.com. We want to make sure the purchase happened on abccart.com is attributed to the correct traffic source, in this case, a promotional email, instead of a referral from abc.com.

On abc.com GTM Google Analytics tag, find More settings > Cross Domain Tracking. Put abccart.com as 1 of the Auto Link Domains as follows:

GTM GA tag on abc.com

Now on abccart.com GTM Google Analytics tag, find More settings > Cross Domain Tracking again. And this time, set Allow Linker to be True:

GTM GA tag abccart.com

 

The above is exactly what we’ve done in my previous post, just now we no longer need to write the JavaScript ourselves….we can set them up using GTM user interface!! Lovely!

And….what about if I shared the same GA tag between abc.com and abccart.com? You can put the tag like this (kind of merging the 2 tags into 1):

GTM GA tag 1 single tag

 

So you’re done with the GTM setup! Congratulations!

Now to make the cross domain tracking really works, remember to go to your Google Analytics Admin setting:

UA admin

Select the right PROPERTY, then select Tracking Info > Referral Exclusion List:

UA-referral exclusion list

Add abc.com in the exclude domain list:

UA-exclude-domain

What we’re doing here is basically ask Google Analytics NOT to create a new session whenever they see traffic coming from the 3rd party domain (in this case, abccart.com)

Summary

To sum up, what we’ve done here are:

  • Set up autoLink plugin in abc.com (the original domain) using GTM, so that whenever there’s a link to abccart.com (3rd party domain), the GA identifier is appended to the URL and cookies can get transferred
  • Set up allowLinker config in abccart.com (3rd party domain) using GTM, so that it allows cookies to be accepted from abc.com (the original domain)
  • Add abccart.com (3rd party domain) as an excluded referral under the referral exclusion list in GA admin settings. This is to make sure traffic from the 3rd party domain won’t trigger a new session
  • All these together ensure a single visit across different top level domains

I hope you will find this useful and even easier than to implement the GA cross domain tracking by code. If you have any questions regarding the setup, feel free to leave me message! And a big big thanks again to Simo Ahava for helping me on completing the setup (originally I missed the domain exclusion so it didn’t work). I highly recommend you to visit his blog as you can find tons of useful GTM articles, especially when you’re looking for more advanced killer tips!


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images