如何在magento 1.9中手动添加GTM或Google Analytics代码/代码段(主要用于GTM)

时间:2021-07-25 00:26:52

Can anyone explain me how to add google tag manager code snippet to magento 1.9 manually (i.e. without extensions) in miscellaneous code the code is being placed at closing body tag. I want it to be placed after opening body tag.I want the path and which part to be edited

任何人都可以解释我如何在杂项代码中将google标记管理器代码片段手动添加到magento 1.9(即没有扩展名),代码放在关闭正文标记处。我希望它在打开body标签后放置。我想要路径和要编辑的部分

Link 1 Link 2

链接1链接2

1 个解决方案

#1


-1  

i have got a solution for it.

我有一个解决方案。

Step 1: goto app\design\frontend\rwd(your theme package)\default\template\page and open 1column.phtml, 2column-left.phtml, 2column-right.phtml, 3column.phtml in a editor.
Step 2: Paste your GTM snippet below this code (getChildHtml('after_body_start') ?>) in all the .phtml pages given in step 1.
Step 3:save the code and check ifit fires in all pages or not. 

P.S.: If your gtm does not fire in success/thank you page. paste the code in (\app\design\frontend\base\default\template\checkout\sucess.phtml) anywhere you like.

#1


-1  

i have got a solution for it.

我有一个解决方案。

Step 1: goto app\design\frontend\rwd(your theme package)\default\template\page and open 1column.phtml, 2column-left.phtml, 2column-right.phtml, 3column.phtml in a editor.
Step 2: Paste your GTM snippet below this code (getChildHtml('after_body_start') ?>) in all the .phtml pages given in step 1.
Step 3:save the code and check ifit fires in all pages or not. 

P.S.: If your gtm does not fire in success/thank you page. paste the code in (\app\design\frontend\base\default\template\checkout\sucess.phtml) anywhere you like.