var _gaq undefined – Magento

Posted by Tim on March 1, 2010 in Open Source, PHP |

I came across this javascript error when updating a instance of Magento to version 1.4 and Google Analytics

“var _gaq is undefined”

In the ga.php file located under /app/code/core/Mage/GoogleAnalytics/Block add the following line of code before _gaq.push javascript

“var _gaq = _gaq || [];” – about line 179

This will remove the error.   I still need to test to see if visitor site numbers have been affected.

References:

http://www.magentocommerce.com/boards/viewthread/68885/

http://www.magentocommerce.com/boards/viewthread/68885/”

Tags:

Leave a Reply

Copyright © 2008-2012 Codelab Blog All rights reserved.
Desk Mess Mirrored version 1.9.1 theme from BuyNowShop.com.