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

Please help a amateur insert 2 tracking codes in 1 website.

N/A
# 1
N/A

Hello guys!

I have already 1 tracking code inserted correctly on my website. Now i want to add a new property on the same analytics account, and insert this new tracking code on my website.

The thing is on my websites admin i only need to type in the UA-xxxxxxxx-x code and it creates a script automaticly and that makes it really easy for me. Now for this new property i created, i got a new tracking code that was similar to my first one but ends with another number.

So my question to you is if i go to my websites admin and place this new tracking code besides my first one, will this be ok? or will it somehow affect badly?

This is how the script looks on my website when i have both tracking codes inserted.

 

<script type="text/javascript">
<!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-->
</script>

<script type="text/javascript">
<!--
var pageTracker = _gat._getTracker("UA-xxxxxxxx-2");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
-->
</script>
<script type="text/javascript">
<!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-->
</script>

<script type="text/javascript">
<!--
var pageTracker = _gat._getTracker("UA-xxxxxxxx-1");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
-->
</script>

 

I would really appriecete if someone could help me with this Smiley Very Happy

1 Expert replyverified_user

Re: Please help a amateur insert 2 tracking codes in 1 website.

Top Contributor
# 2
Top Contributor
Though you can have multiple tracking codes on the same site, you should change the tracker names so that there is no confusion about which property data is sent to. For example, if you want to track a specific event to one property by not the other, then how would you do that? You need to name your trackers so that the event goes to the intended property.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn