开发者

Does preloading content from a page skew my google analytics stats?

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 w开发者_运维知识库ith 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"?


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).


If you want to ajaxify your site by removing pages and replacing them with ajax requests, then all you need to do on the GA side of things is call _trackPageView whenever a page view should be tracked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜