Magento: GoogleAnalytics fix

http://www.panticz.de/sites/default/files/magento/GoogleAnalytics/Ga.php.diff

--- ./app/code/core/Mage/GoogleAnalytics/Block/Ga.php.org	2010-12-01 16:30:16.000000000 +0100
+++ ./app/code/core/Mage/GoogleAnalytics/Block/Ga.php	2010-12-01 16:33:05.000000000 +0100
@@ -177,6 +177,7 @@
         (document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(ga);
     })();
 
+    var _gaq = _gaq || [];
     _gaq.push(["_setAccount", "' . $this->getAccount() . '"]);
     _gaq.push(["_trackPageview", "'.$this->getPageName().'"]);
 //]]>
1

wget http://www.panticz.de/sites/default/files/magento/GoogleAnalytics/Ga.php.diff -O /tmp/Ga.php.diff
patch -p2 ./app/code/core/Mage/GoogleAnalytics/Block/Ga.php < /tmp/Ga.php.diff

#
# TEST
#
# get source code
cd /tmp/
svn checkout http://svn.magentocommerce.com/source/branches/1.4-trunk

# trunk
cd /tmp/1.4-trunk/

# pack
tar cjf GoogleAnalytics.tar.bz2 app/code/core/Mage/GoogleAnalytics/ app/design/frontend/base/default/layout/googleanalytics.xml app/locale/en_US/Mage_GoogleAnalytics.csv --exclude=.svn

# transfer archive to your magento machine
scp /tmp/1.4-trunk/GoogleAnalytics.tar.bz2 root@YOUR_MAGENTO_IP:/tmp

# extract
diff app/code/core/Mage/GoogleAnalytics/ /var/www/app/code/core/Mage/GoogleAnalytics/ -r

# Links
http://www.magentocommerce.com/boards/viewthread/23325/P45/
http://www.magentocommerce.com/boards/viewthread/77774/#t215469