开发者

Magento Google Analytics Code is not showing

开发者 https://www.devze.com 2023-01-24 13:54 出处:网络
I am new 开发者_Python百科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 Anal

I am new 开发者_Python百科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).


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消