: Can we use both Google Analytics (Asynchronous) and Google Analytics with Display Advertising code in same page I have Google Analytics (Asynchronous) script <script type=”text/javascript”>
I have Google Analytics (Asynchronous) script
<script type=”text/javascript”>
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_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
Google Analytics with Display Advertising Script
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X-yz']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
The UA - codes are different can i use both the codes ?
I've read some where that Universal Analytics will not interfere with previous versions of Google Analytics.
If i have upgraded to Universal Analytics,
If the UA - codes are different should i use only the Universal Analytics script or should i use both Universal Analytics script and Universal Analytics script.
please advise.....
More posts by @Ravi8258870
2 Comments
Sorted by latest first Latest Oldest Best
There is no need to have two GA codes to enable display advertising features. Use one Universal Analytics tracking tag with the display features enabled.
Under the Analytics Admin pane, go to Property Settings. Under Advertising Features, make sure this is set to on. Your tracking code will be updated to reflect this change.
Here is a question on StackOverflow in which the poster discovers that a universal analytics snippet and an old style analytics snippet clash.
That person was able to solve their problem with a multiple tracker method:
ga('create', 'UA-00000000-0', {'name': 'myTracker'});
Even if those two didn't conflict now, they might start conflicting when Google migrates all accounts to universal analytics.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.