admin管理员组文章数量:1318771
I am wondering what happens if I lazy load Google Analytics JavaScript few seconds after the page has loaded (i.e. few seconds after the document and all images/stylesheet/javascript is loaded). Will it still record the statistics correctly? I am trying to defer loading of javascript in order to improve my page load time; GA-JS is one of the 6 scripts that I plan to lazy load.
PS: I know how to lazy-load the script.
I am wondering what happens if I lazy load Google Analytics JavaScript few seconds after the page has loaded (i.e. few seconds after the document and all images/stylesheet/javascript is loaded). Will it still record the statistics correctly? I am trying to defer loading of javascript in order to improve my page load time; GA-JS is one of the 6 scripts that I plan to lazy load.
PS: I know how to lazy-load the script.
Share Improve this question edited Oct 28, 2011 at 13:59 Asaph 163k25 gold badges203 silver badges204 bronze badges asked Oct 28, 2011 at 13:47 Salman ArshadSalman Arshad 272k84 gold badges443 silver badges534 bronze badges1 Answer
Reset to default 9It will obviously exclude all users that close their browser before your intentional delay has elapsed. So the counts will be wrong. And this will influence the "bounce rate" number reported in Google Analytics significantly. I remend not trying to improve page the load time of Google Analytics. Google has already invested significantly in trying to optimize that. And every site that uses Google Analytics is paying the same load time penalty. So it's a level playing field. Just follow their best practices for where to put the code snippet and look for other opportunities to improve page load time.
本文标签: Load google analytics javascript few seconds after the page has loadedStack Overflow
版权声明:本文标题:Load google analytics javascript few seconds after the page has loaded - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742046785a2417832.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论