将Google标记管理器添加到Magnolia CMS

问题描述 投票:1回答:1

我有一个使用Magnolia CMS构建的网站,我需要在一个页面上添加Google跟踪代码管理器。我已经编写了代码,我需要将其添加到页面中,所以我只需要帮助,就可以将该代码添加到Magnolia页面中:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i)
Unknown macro:
Unknown macro: {w[l]=w[l]||[];w[l].push( Unknown macro}
);var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KFVHMZ5');</script>
<!-- End Google Tag Manager -->
Additionally, paste this code immediately after the opening <body> tag:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KFVHMZ5"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
java magnolia
1个回答
0
投票

使用Marketing Tags module。那是最简单的解决方案。或者,您可以将其添加到所有页面模板中并由您自己管理,但是我不会这样做。

© www.soinside.com 2019 - 2024. All rights reserved.