gpt4 book ai didi

google-analytics - 谷歌分析中的浏览器窗口大小?

转载 作者:行者123 更新时间:2023-12-03 15:26:57 25 4
gpt4 key购买 nike

我们正在尝试在 Google Analytics 中捕获实际浏览器窗口大小的报告。我知道他们有页面内分析,但这不提供数据,只是一个可视化。任何人都知道我们是否遗漏了什么,或者我们是否需要将其添加为自定义事件?

这真的有必要吗?

<script type="text/javascript">
var width = window.innerWidth || document.body.clientWidth;
var height = window.innerHeight || document.body.clientHeight;

width = Math.round(width/100)*100;
height = Math.round(height/100)*100;

var size = width + "x" + height;
_gaq.push(['_trackEvent', 'Browser Size', 'Range', size]);
</script>

最佳答案

您确实需要添加自定义事件。我尝试了您拥有的 javascript,但它与 Google Analytic 的跳出率相冲突。您需要将 opt_noninteraction 变量传递为“true”,否则 Google 会将事件视为用户交互。跟踪浏览器窗口大小不是用户交互,应从跳出率计算中排除。

这是修改后的代码:

<script>
var width = window.innerWidth || document.body.clientWidth;
var height = window.innerHeight || document.body.clientHeight;
width = Math.round(width/10)*10;
height = Math.round(height/10)*10; //Using a 10 pixel granularity

var size = width + "x" + height;
_gaq.push(['_trackEvent', 'Browser Size', 'Range', size,, true]); //don't count in Bounce Rate
</script>

关于google-analytics - 谷歌分析中的浏览器窗口大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19497744/

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