Mobile app version of vmapp.org
Login or Join
Candy875

: What are the implications of having two Google Analytics tracking codes on 1 site? What are the implications of having two tracking codes on 1 site? Both codes will be right under neath one

@Candy875

Posted in: #Analytics #GoogleAnalytics #Tracking

What are the implications of having two tracking codes on 1 site? Both codes will be right under neath one another

e.g.

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-account-1']);
_gaq.push(['_setDomainName', 'mydomain']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// ]]></script>


and

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-account-2']);
_gaq.push(['_setDomainName', 'mydomain']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// ]]></script>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

1 Comments

Sorted by latest first Latest Oldest Best

 

@Smith883

Google allows Multiple tracking codes on web pages however some configs may not be supported.


You can install multiple instances of the Google Analytics tracking
code on your web pages to send data to multiple properties in your
account.

Not all configurations are supported. You can, for example, install
multiple instances of the Universal Analytics tracking code
(analytics.js) on your web pages but only one instance of the Classic
Analytics code (ga.js). Multiple instances of ga.js might result in
inaccurate data collection, processing, or reporting. You can,
however, install one or more instances of analytics.js on web pages
that also have a single instance of ga.js.

Using multiple tracking codes might be useful if users with access to
different properties need to see data from the same web site, or if
you have multiple versions of a web site. You might, for example, want
to collect data from example.com using one instance of analytics.js,
collect data from example.co.uk in another instance of analytics.js,
and use a third instance of analytics.js on both websites to see the
aggregate data.


Using Multiple Tracking Objects you can combined multiple Google Analytics ID's and accounts, this is useful for multiple site owners overseeing all of parts of the website. This can be done by editing the JavaScript see the example below:

ga('create', 'UA-XXXX-Y', 'auto');
ga('create', 'UA-12345-6', 'auto', 'newTracker'); // New tracker.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme