in Open Source

var _gaq undefined – Magento

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/”