【发布时间】:2018-06-07 18:33:54
【问题描述】:
由于 AVG 法律,我想知道如何使 IP 地址匿名,用于 Google Analytics .JS 代码(删除最后一组数字)。
我知道它在 Google 的文档中有所解释,但问起来总是很方便。
文档引用了可以添加到跟踪的“anonymizeIp”类。但是,如果您想在此脚本中使用它,如何才能做到最好呢?
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xx');
</script>
【问题讨论】:
标签: google-analytics