We have an older site that still uses the ancient Google Analytics tracking code (pre asynchronous); we would like to update it to the current asynchronous gaq code.
If someone made the same switch, a couple of questions ...
1) As soon as we make the switch, will the user's cookies be transferred from the old code? Or will Analytics now โforgetโ visitors who have already visited our site and consider everyone who receives an updated asynchronous snippet of new visitor code?
2) The site is quite complex; weโll probably have to โhuntโ for all sections of the site that have the old tracking code. While we are doing this code cleanup, will the old "gat" code and the new "gaq" code be compatible? This means that they will correctly count page views, will not lose referrer information and only count one visit, even if the user clicks on both pages that contain the old code and those that contain the new code during their visit?
Thanks! And just for reference, here is our current (old) code:
<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"> try { var pageTracker = _gat._getTracker("UA-#######-#"); pageTracker._trackPageview(); } catch(err) {}</script>
source share