AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.3K members online now
1.3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Cross domain tracking with GTM doesn't work as supposed

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

My customer runs some Adwords campaigns to get people on his sites A.com, B.com and C.com. Each of them point to X.com where the shop is located. He wants to track goals and turnover based on his Adwords campaigns.

 

  • Site A.com has it's own GA property ID and GTM container 
  • Site B.com has it's own GA property ID and GTM container 
  • Site C.com has it's own GA property ID and GTM container 
  • Site X.com has it's own GA property ID and GTM container 

I implemented cross domain tracking on each Universal Analytics Tag in every container (allowLinker = true, cookie.Domain = auto) and the trigger is pageview. I created an Auto Link Domains Variable and added it to every containers tag.

 

In GA I added the domains in the Referral Exclusion List and finally I added a filter to prepend Hostnames.

 

But in the GA reporting of site X.com I don't see any pages from the other sites nor any AdWords source tracking.

Is there something I just didn't think about? Do you have a hint?

 

Thanks in advance!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Andreas G
July 2017

Cross domain tracking with GTM doesn't work as supposed

Top Contributor
# 2
Top Contributor

Hey Andreas, 

 

#1 I recommend you create a property that is implemented cross all 4 of your websites. 

 

#2 I might be wrong here but your properties will not be able to complete cross domain tracking if they're not implemented on all the domains.

 

The code implemented should look like the following: 

<script>

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['example-2.com'] );

ga('send', 'pageview');

</script>

 

Are you making sure to include all the other domains? 

 

It sounds like you should create a dedicate property for each domain and a property that goes across ALL domains. 

 

Let me know if this helps! 

- Josh

Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Andreas G
July 2017

Cross domain tracking with GTM doesn't work as supposed

Top Contributor
# 2
Top Contributor

Hey Andreas, 

 

#1 I recommend you create a property that is implemented cross all 4 of your websites. 

 

#2 I might be wrong here but your properties will not be able to complete cross domain tracking if they're not implemented on all the domains.

 

The code implemented should look like the following: 

<script>

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['example-2.com'] );

ga('send', 'pageview');

</script>

 

Are you making sure to include all the other domains? 

 

It sounds like you should create a dedicate property for each domain and a property that goes across ALL domains. 

 

Let me know if this helps! 

- Josh

Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Cross domain tracking with GTM doesn't work as supposed

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Josh,

 

great! Thanks for your effort! I thought GTM would connect the different IDs automatically. But your posting inspired me to create a second Analytics tag with the property ID of site X.com for each container to connect the domains. Works great!!! Thanks a lot!

 

Regards from Germany

Andreas