【问题标题】:How do i secure my google tag manager id for my domain我如何保护我的域的谷歌标签管理器 ID
【发布时间】:2023-02-02 16:52:12
【问题描述】:
我已将 google 标签管理器与我的 SPA 应用程序 (ReactJS) 集成
const tagManagerArgs = {
gtmId: 'GTM-000000'
}
TagManager.initialize(tagManagerArgs)
我相信通过检查源代码,任何人都可以看到 gtmId(标签管理器 ID)并将事件发送到我们的工作区。
问题是我们如何限制此标签 ID 接受来自特定域的请求或加密/解密,以便其他人无法使用此标签 ID。
【问题讨论】:
标签:
javascript
reactjs
google-analytics
analytics
google-tag-manager
【解决方案1】:
Unfortunately, there is no way to fully secure the Google Tag Manager ID or restrict it to a specific domain through code. The best approach is to secure your website and limit access to sensitive information through user authentication and access control. You can also set up a referral exclusion list in GTM to limit the domains that are allowed to send data to your workspace, but this will not prevent someone from using the GTM ID on a different domain if they have obtained it.