gpt4 book ai didi

javascript - ajax 网站的谷歌分析综合浏览量

转载 作者:行者123 更新时间:2023-11-29 19:45:24 25 4
gpt4 key购买 nike

如果页面的 url 通过 javascript 更改,google analytics 是否会计算综合浏览量?

例如。首先,我在浏览器中打开页面 example.com/about(1 pageview),然后单击链接联系人,但我没有通过 ajax 重定向,而是拉取该页面,插入到正文中页面并编辑 url - 通过这种方式从 example.com/aboutexample.com/contacts

Modify the URL without reloading the page

因此,无需刷新页面即可更改 url。 google analytics会计算第二次综合浏览量,还是仍然是一次综合浏览量?如果它不会被计算在内,我可以更改它会计算的一些选项吗?

谢谢

最佳答案

如果您使用 AJAX 加载页面,Google Analytics 无法统计页面更改。每次通过 JavaScript 更改页面时,您都需要使用 _trackPageView 函数手动注册综合浏览量。 Here's the documentation .

_gaq.push(['_setAccount', 'UA-12345-1']);
_gaq.push(['_trackPageview', '/home/landingPage']);

关于javascript - ajax 网站的谷歌分析综合浏览量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20074156/

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