Google Analytics issue in Magento 1.4

Written by Mark Clark - Sat May 1, 10:23 am ET

If you have upgraded to Magento 1.4.0.0 and 1.4.0.1 your Google Analytics tracking will not work any more. This is due to two bugs in these releases which misses a essential line in the Google Analytics code in Magento Core.

To fix this issue do the following.

  1. Open up your app/code/core/Mage/GoogleAnalytics/Block/Ga.php file
  2. Go to aprox line #179, and add the line below right above the two lines below
    var _gaq = _gaq || [];
        _gaq.push(["_setAccount", "' . $this->getAccount() . '"]);
        _gaq.push(["_trackPageview", "'.$this->getPageName().'"]);

    http://www.magjournal.com/files/Ga.zip

  3. Next, open up your app/design/frontend/base/default/layout/googleanalytics.xml file and rename "before_body_end" to "before_body_end".

We have got a confirmation from Varien that this bug has been adressed and solved and will so be included in the next Magento release, however it is NOT 100% fixed in the latest SVN update so please follow these instructions to solve it.

The bug has also been reported here (among other places):
http://www.magentocommerce.com/bug-tracking/issue/?issue=8492

No related posts.

  • Share: