【问题标题】:GTM's Noscript tag - is it required?GTM 的 Noscript 标签 - 是必需的吗?
【发布时间】:2019-07-20 04:17:33
【问题描述】:

在 Google 跟踪代码管理器中,它们提供了两个必须添加到您的页面的脚本:

<!-- place within <head> -->
<!-- Google Tag Manager -->
<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=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-ID');</script>
<!-- End Google Tag Manager -->

<!-- place within <body> -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ID"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

我了解该部分的目的是在用户未启用 javascript 时加载。如果我将这个标签从我的身体中排除,会有什么影响?

【问题讨论】:

    标签: google-tag-manager noscript


    【解决方案1】:

    好吧,您将无法衡量禁用 Javascript 的用户的网页浏览量(但后来您知道了)。

    在 GTM noscript 标签中起作用的唯一标签是自定义图像标签,如果您想从页面获取值,它们需要作为键/值对(即查询字符串)附加到 noscript 标签中的 GTM url .

    你必须自己判断这是否值得你费心。

    IIRC 如果没有实施 noscript 事情,您将无法通过 GTM 代码为 Google Search Console 验证网站,但这是可能发生的最坏情况。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-09
      • 1970-01-01
      • 1970-01-01
      • 2022-07-14
      • 1970-01-01
      • 2020-03-28
      • 1970-01-01
      • 2018-03-11
      相关资源
      最近更新 更多