gpt4 book ai didi

javascript - google analytics javascript security - property ID public

转载 作者:行者123 更新时间:2023-11-30 18:07:29 26 4
gpt4 key购买 nike

我读过以下问题:Security on Google Analytics and other client-side analytics tools?

但我需要一个更简单的答案。

根据谷歌分析网站,我将以下代码放在我网站的 header 中:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'propertyID']);
_gaq.push(['_setDomainName', 'brokersqueeze.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

虽然这里的大多数读者可能很明显,但我意识到所有这些信息(如 PropertyID)都可以通过浏览器中的“检查元素”获得。

我是否正确放置了 GA 代码段?或者有没有办法让我们的 GA 对公众隐藏信息?上述问题的答案似乎表明,虽然信息是公开的,但每个人都面临着这种风险。我有这个权利吗?

最佳答案

是的,你做对了。每个客户端分析工具都存在这种风险。如果他们向 GA 发送欺骗性请求,您可以尝试过滤报告中的结果。即使您在 javascript 代码中混淆了 ID,他们也可以捕获 http 请求并获取该 ID。

关于javascript - google analytics javascript security - property ID public,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15468601/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com