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
5.6K members online now
5.6K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Multiple Google Analytic Tags Only Record First Site

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a solution in which I am trying to implement multiple Google Analytics tags, but it only records for one site. This is the code we are using:

<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-XXXA-1', 'example.com');
ga('create', 'UA-XXXB-1', {'name': 'newTracker'}); // New tracker.
ga('send', 'pageview');
ga('newTracker.send', 'pageview'); // Send page view for new tracker </script>

We own one of the the GA tracking codes, but not the other. What is weird that if we switch the order, only the top site receives the data and not the bottom. Any thoughts?

 

1 Expert replyverified_user

Re: Multiple Google Analytic Tags Only Record First Site

Top Contributor
# 2
Top Contributor
Hi Devin,

I checked your code using two test properties and it is sending data for both. Can you share your site URL so we can take a look at your setup?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Multiple Google Analytic Tags Only Record First Site

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Sure! This is the url: http://wordpressforbroadcasters.com . Tracking codes will be in the source.

Re: Multiple Google Analytic Tags Only Record First Site

[ Edited ]
Explorer ✭ ✭ ✭
# 4
Explorer ✭ ✭ ✭

I see both tracking codes being fired Smiley Happy