Analytics
3.1K members online now
3.1K 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

Multiple Tracking Issue

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

Hello,

 

I have implemented below multiple tracking code on my site. I am only able to see website hits on one account. Can anyone please help?

 

Code :

 

<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3333653-1', 'auto');
ga('create', 'UA-96937350-1', 'auto', ‘Xyz’);
ga('send', 'pageview');
ga(‘Xyz.send’, ‘pageview’);
</script>

 

 

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author Ronak D
April 2017

Re: Multiple Tracking Issue

Top Contributor
# 2
Top Contributor

Hi @Ronak D :-)

Is that a copy paste of the code from the site?
If so, there are syntax errors in some of the single quotes 

 

I' m copy/pasting from your given code example and enlarging+marking in red the applicable code for readability, so as to see where the characters are different/incorrect. You can see how the single quotes in red, differ to the single quotes left in black.

 

If you re-edit the code with something like notepad or another plain text editor, it should correct the incorrect red ones.

 

<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3333653-1', 'auto');
ga('create', 'UA-96937350-1', 'auto', ‘xyz’);
ga('send', 'pageview');
ga(‘xyz.send’, ‘pageview’);
</script>

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Multiple Tracking Issue

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hello Bronwyn,

 

Yeah, this was the exact issue.

 

Now fixed, thanks for your help.