我在正文標記內的SharePoint主頁中添加了GTM代碼。Google跟蹤代碼管理器(GTM)無法在SharePoint上工作
<body>
<--Body content goes here -->
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T9XLSX');</script>
<!-- End Google Tag Manager -->
</body>
但似乎腳本沒有正確解僱,因爲整個內容被一個表單元素包裝如下,它由SharePoint生成。
<body>
<form method="post" action="" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
<--Body content goes here -->
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T9XLSX');</script>
<!-- End Google Tag Manager -->
</form>
</body>
有沒有一種方法可以在SharePoint中正確放置標記?
它適合我。 – 2014-10-01 10:39:04
當我們在masterpage中進行任何更新時,這段代碼就會消失。任何人都可以請建議一個解決方案。 – 2014-11-23 18:23:12