我想自己写一个简单的脚本,它使用AJAX将我主要导航栏上每个页面的内容加载到当前页面上的隐藏div中。
这样做的目的是让我可以尽可能多地预加载我的重要内容,并在用户的计算机上缓存(希望),然后才能完成当前页面,然后继续前进。
我担心的是,每次访问网站时,对网站上的每个页面发出请求都会严重破坏我的Google Analytics(分析)统计信息的有效性。
AJAX如何与Google Analytics(分析)交互? 它是否被视为“网页访问”?
I'd like to write myself a simple script that uses AJAX to load the content from each page on my main navbar into a hidden div on the current page.
This is just so that I can preload as much of my important content as possible and get it cached on the user's computer (hopefully) before they've finished with the current page and want to move on.
I'm concerned that doing a request for every page on the site, every time someone visits, will really ruin the validity of my google analytics stats.
How does AJAX interact with google analytics? Does it count as a "page visit"?
最满意答案
如果您在不运行嵌入式脚本的情况下检索每个页面,则Google Analytics代码将不会运行,并且不应该算作页面视图。 我建议在检索每个页面后不要对代码进行任何操作(即不要将内容插入到隐藏的div中)。
If you retrieve each page without running the embedded script, then the Google Analytics code would not be run and it should not count as a page view. I suggest not doing anything with the code after retrieving each page (i.e. not inserting the content into a hidden div).
更多推荐
发布评论