Problem:- I recently upgraded a Magento shop from version 1.6 to 1.7 and suddenly the Google Analytics stopped tracking data.
Solution:- You need to add ‘template’ attribute to googleanlytics block in app/design/frontend/your_package/your_theme/layout/googleanalytics.xml
Note:- If you are using the default Magento design then
your_package = default or base
your_theme = default
Here is the edited googleanalytics.xml file:-
Note that, we have added template=”googleanalytics/ga.phtml” in the code file below.
File: app/design/frontend/your_package/your_theme/layout/googleanalytics.xml
<layout version="0.1.0">
<!--
Default layout, loads most of the pages
-->
<default>
<!-- Mage_GoogleAnalytics -->
<reference name="after_body_start">
<block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
</reference>
</default>
</layout>
Hope it helps. Thanks.