Home » Google, Magento5 June 2012

Magento: Solution for Google Analytics not tracking website

I had an old version of Magento. I had enabled google analytics tracking from Magento admin. But, google analytics was not tracking my webshop.

The main reason behind this was that Google had modified its analytics tracking code and the GoogleAnalytics core module of Magento had old tracking code.

To fix this issue, do the following:-

– Make a local copy of /app/code/core/Mage/GoogleAnalytics/Block/Ga.php

i.e. COPY /app/code/core/Mage/GoogleAnalytics/Block/Ga.php
TO /app/code/local/Mage/GoogleAnalytics/Block/Ga.php

– Open the file

/app/code/local/Mage/GoogleAnalytics/Block/Ga.php

– Go to line 171

– You will see the following code:

– Replace it with the following code:

Now, Google Analytics should be able to track your webshop.

Thanks.

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.