Has anyone else noticed that google analytics isn't reporting all of your visitors? When I switched from zencart to magento the visits practically disappeared, anyone else have this issue?
There is a bug in the code for 1.4.0.1 My analytics for a client showed 600 visits per day constant and then about 17 per day after upgrade. The Google API doesnt work properly and you need to edit the ga.php file. /app/code/core/Mage/GoogleAnalytics/Block/Ga.php - edit this file, line 171 You have to add 1 line to get rid of errors in IE and change the sequence. Take a look at official GA code. http://code.google.com/intl/pl/apis/analytics/docs/tracking/asyncTracking.html <!-- BEGIN GOOGLE ANALYTICS CODE --> <script type="text/javascript"> //<![CDATA[ (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\'; (document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(ga); })(); var _gaq = _gaq || []; _gaq.push(["_setAccount", "' . $this->getAccount() . '"]); _gaq.push(["_trackPageview", "'.$this->getPageName().'"]); //]]> </script> <!-- END GOOGLE ANALYTICS CODE -->
its the _gaq push area of the code. Just look at the official code in the URL, then adjust that line. After that, using your UA in the Google API of magento should work as per normal, including e-commerce tracking if you have e-commerce selected in your Analytics account.