Forum Moderators: DixonJones
I added two UA tags but Google only provided tracking information to the second UA tag.
Does anyone know if it is possible to have two or more Google UA tags on the same page?
I've got the same problem. Does anybody know if it's possible?
<script type="text/javascript">
var firstTracker = _gat._getTracker("UA-YYYYYYY-1");
firstTracker._initData();
firstTracker._trackPageview();
var secondTracker = _gat._getTracker("UA-ZZZZZZZ-1");
secondTracker._initData();
secondTracker._trackPageview();
</script>
Thanks for your post!
In the Website I want to track I have the following code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-YYYYYYY-3";
_uacct = "UA-ZZZZZZZ-1";
urchinTracker();
</script>
</body>
</html>
I will substitute your code for my 6 current code lines above. Is that all I need to do?
I can't test it right now because I don't have FTP access with me.
Tanks a lot!
Adding the new tracking code [google.com]
There is a migration guide [google.com] on the analytics site, for converting more complicated tracking.
In the migration guide it shows an example of multiple tracking for the older version:
<script type="text/javascript">
_uacct = "UA-#*$!XX-X";
urchinTracker();
_uff = 0; // Reset flag to allow for second account
_uacct = "UA-#*$!XX-X";
</script>
I have never used the older version but I think there might be a typo. If the above code doesn't work I would try:
<script type="text/javascript">
_uacct = "UA-YYYYY-Y;
urchinTracker();
_uff = 0; // Reset flag to allow for second account
_uacct = "UA-ZZZZZ-Z;
urchinTracker();
</script>
Welcome to Webmasterworld BTW.