在 Google Tag Manager 上设置 Live 环境的正确方法是什么?
What is the proper way to setup Live environment on Google Tag Manager?
使用 Google 跟踪代码管理器,我想使用 Environments 功能。
虽然环境设置非常简单,但有一个关于 Live 环境设置的特殊情况。更具体地说,documentation 提到:
Note: Every container is set up with a "Live" environment by default, which always points to the container version that is currently published. You don't need to define the Live environment.
现在,为了在我的网站上为 Live 设置 GTM,我有 2 个可能的片段:“默认”片段(可以通过管理员获取 > 在我的容器中安装 Google 标签管理器)和“实时”片段(可通过管理 > 环境 >“实时”>(操作)获取片段获取)。
这里的问题是第一个脚本似乎没有正确映射到 Live 环境,因为在查找中使用它 Table,映射到默认值。
另一方面,第二个脚本似乎运行正常。我担心的是它使用了 2 个附加参数(gtm_auth
和 gtm_preview
),我不确定是否应该将它们定义为 Live 环境。此外,一些博客建议在 Live 环境中使用第一个脚本。
我的问题和顾虑是,就正确安装、使用和安全性而言,这 2 个脚本中的哪一个最适合用于在 GTM 中设置 Live Environment?
请考虑建议使用不同的容器不是一种选择。
您遇到的是预期行为。根据 documentation 内置 Environment
变量定义如下:
Environment Name: Returns the user-provided name of the current environment, if the container request was made from an environment
"Share Preview" link or from an environment snippet. For the built-in
environments, it will return "Live", "Latest", or "Now Editing". In
all other cases it returns an empty string.
在这种情况下,当使用 "Share Preview" 或 Admin > Environments > "Live" > (Actions) Get Snippet 中的片段时,将导致填充变量。
在我的容器中使用“管理”>“安装 Google 跟踪代码管理器”中的代码段时,变量将为空,因为它不是环境代码段。
在安装方面,我建议使用非环境代码片段版本进行直播,因为公开共享的信息较少(来自 gtm_auth 和环境参数的值)
使用 Google 跟踪代码管理器,我想使用 Environments 功能。 虽然环境设置非常简单,但有一个关于 Live 环境设置的特殊情况。更具体地说,documentation 提到:
Note: Every container is set up with a "Live" environment by default, which always points to the container version that is currently published. You don't need to define the Live environment.
现在,为了在我的网站上为 Live 设置 GTM,我有 2 个可能的片段:“默认”片段(可以通过管理员获取 > 在我的容器中安装 Google 标签管理器)和“实时”片段(可通过管理 > 环境 >“实时”>(操作)获取片段获取)。
这里的问题是第一个脚本似乎没有正确映射到 Live 环境,因为在查找中使用它 Table,映射到默认值。
另一方面,第二个脚本似乎运行正常。我担心的是它使用了 2 个附加参数(gtm_auth
和 gtm_preview
),我不确定是否应该将它们定义为 Live 环境。此外,一些博客建议在 Live 环境中使用第一个脚本。
我的问题和顾虑是,就正确安装、使用和安全性而言,这 2 个脚本中的哪一个最适合用于在 GTM 中设置 Live Environment?
请考虑建议使用不同的容器不是一种选择。
您遇到的是预期行为。根据 documentation 内置 Environment
变量定义如下:
Environment Name: Returns the user-provided name of the current environment, if the container request was made from an environment "Share Preview" link or from an environment snippet. For the built-in environments, it will return "Live", "Latest", or "Now Editing". In all other cases it returns an empty string.
在这种情况下,当使用 "Share Preview" 或 Admin > Environments > "Live" > (Actions) Get Snippet 中的片段时,将导致填充变量。
在我的容器中使用“管理”>“安装 Google 跟踪代码管理器”中的代码段时,变量将为空,因为它不是环境代码段。
在安装方面,我建议使用非环境代码片段版本进行直播,因为公开共享的信息较少(来自 gtm_auth 和环境参数的值)