通过Cookie值设置Google跟踪代码管理器变量anonymizeIp

时间:2019-07-30 10:39:18

标签: google-analytics google-tag-manager

使用Google跟踪代码管理器脚本(而非Google Analytics(分析)或gatag.js),并希望仅在用户接受Cookie时才能将anonymizeIp设置为true

这可能吗?据我了解,在Google跟踪代码管理器中设置变量意味着该变量始终设置为false或true。

1 个答案:

答案 0 :(得分:0)

您需要在GTM中创建一个变量来跟踪Cookie的接受程度(请确保将undefined和null条件检查为“ false”: enter image description here

然后在您的GA设置变量或GA标签中,只需引用Cookie变量:enter image description here