Google Analytics(分析)是否有性能开销? [英] Does Google Analytics have performance overhead?

查看:154
本文介绍了Google Analytics(分析)是否有性能开销?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Analytics会在多大程度上影响效果?

我在寻找以下内容:

  • 基准测试(包括响应时间/页面载入时间等)
  • 链接或类似基准测试结果


    在您的网站上测试Google Analytics(GA)的一种(可能)方法:


    1. 服务ga.js (Google Analytics JavaScript文件)。

    2. 从Google Daily(测试1)和每周(测试2)进行更新。

    我有兴趣了解这会如​​何减少客户端Web服务器和GA服务器之间的通信。



    有没有人执行过任何操作这些测试?如果是这样,你能提供你的结果吗?如果没有,有没有人有更好的方法来测试使用GA的性能命中(或缺乏)?

    解决方案
  • 实施GA的方式是将JS放在页面的底部。这意味着您的DOM的其余部分可以在浏览器甚至考虑访问Google之前加载。这应该让事情变得活泼起来。



    我不建议缓存JS文件。




    • 它可能已经存在于用户缓存中(如果他们大量使用互联网,这种可能性很高)。 共同托管它意味着您的服务器将不必要地承担更多的请求,可能会降低您的核心系统的性能。
    • 浏览器一次只能向一台服务器推送多少请求,因此限制了GA您的域名上的JS可能意味着它需要更长的时间才能得到处理。

    • Google的服务器比您的服务器要好。

    To what extent does Google Analytics impact performance?

    I'm looking for the following:

    • Benchmarks (including response times/pageload times et al)
    • Links or results to similar benchmarks

    One (possible) method of testing Google Analytics (GA) on your site:

    1. Serve ga.js (the Google Analytics JavaScript file) from your own server.
    2. Update from Google Daily (test 1) and Weekly (test 2).

    I would be interested to see how this reduces the communication between the client webserver and the GA server.

    Has anyone conducted any of these tests? If so, can you provide your results? If not, does anyone have a better method for testing the performance hit (or lack thereof) for using GA?

    解决方案

    The common way of implementing GA is putting the JS at the bottom of the page. This means the rest of your DOM can load before the browser even thinks about accessing Google. This should keep things snappy.

    I wouldn't recommend caching the JS file.

    • It might already be in the users cache (quite a high probability if they use the internet a lot) .
    • Co-hosting it would it means your server will needlessly take on a lot more requests, potentially slowing down your core systems.
    • Browsers are limited on how many requests they'll push to one server at a time so sticking the GA JS on your domain will probably mean it takes longer for it to get processed.
    • Google's servers are better than yours.

    这篇关于Google Analytics(分析)是否有性能开销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆