Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Google Analytics Code is not showing

I am new to magento and I have placed my account number in my system > Configuration > Sales > Google API. I have also enabled Google Analytics. But still I can't see the Google Analytics code on any of my magento application. What I have double checked are:

  1. Account Number are proper (These are for the same domain name for which we are trying).
  2. Google Analytics is Enabled (Yes).
like image 374
Pukhraj Prajapat Avatar asked Nov 12 '10 12:11

Pukhraj Prajapat


2 Answers

Same here. It turns out that the problem was caused by my customized theme that was developed for magento 1.5 and now is applied to 1.7.

In app/design/frontend/mytheme/layout/googleanalytics.xml i had:

    <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" />

And it should be:

    <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
like image 170
gtsouk Avatar answered Oct 07 '22 21:10

gtsouk


Have just checked and the google analytics code is normally placed in the after_body_start block.
If that block isn't used in your theme or if you just want to follow better practices change that to before_body_end. You can find the file "googleanalytics.xml" in your theme's layout directory or in app/design/frontend/base/default/layout.

like image 24
clockworkgeek Avatar answered Oct 07 '22 22:10

clockworkgeek