To move the GA code from after <body> tag to before closing </head> tag involves following two steps:
Step 1:
Add the following code with in the <block type="page/html_head" name="head" as="head"> tag in app\design\frontend\base\default\layout\page.xml
<block type="core/text_list" name="before_head_end" as="before_head_end" translate="label">
<label>Page Top</label>
</block>
Step 2:
Now open app\design\frontend\base\default\layout\googleanalytics.xml file and replace
after_body_start
With
before_head_end
Note: Make sure you enabled GA in admin section Magento: Setting Up Google Analytics + eCommerce Tracking
If the changes not reflecting then refresh the Magento cache and check.....
Step 1:
Add the following code with in the <block type="page/html_head" name="head" as="head"> tag in app\design\frontend\base\default\layout\page.xml
<block type="core/text_list" name="before_head_end" as="before_head_end" translate="label">
<label>Page Top</label>
</block>
Now open app\design\frontend\base\default\layout\googleanalytics.xml file and replace
after_body_start
With
before_head_end
Note: Make sure you enabled GA in admin section Magento: Setting Up Google Analytics + eCommerce Tracking
If the changes not reflecting then refresh the Magento cache and check.....
Nice!
ReplyDeleteThank you
Thank you!!!!! Very helpful - not sure what Magento is thinking here - as if they are above Google....hmm.....
ReplyDeleteGreat post!
ReplyDeleteWorks for me! :D
Thank you!