首页 > 解决方案 > 谷歌分析没有收集任何网站速度数据

问题描述

我正在使用analytics.jsGoogle Analytics 的通用跟踪代码。多年来,它一直在收集数据和事件。

但是,站点速度部分(行为 > 站点速度)根本不显示任何数据。我知道 User Timings 需要自定义调用,但 Overview、Page Timings 和 Site Speed Suggestions 根本不包括任何测量。我可以看到它当然有页面浏览量,但没有平均值。例如页面加载时间。

我多次阅读它可能与采样率有关。据我了解,默认值为 1%。每天有超过 50k 的访问者,即使是默认采样率也应该提供足够的数据。在创建跟踪器时,我已经像这样增加了采样率:(siteSpeedSampleRate: 10文档

此外,我使用 GA 调试器扩展来检查某种计时信标是否实际发送到 GA。这是输出:

Initializing Google Analytics.
analytics_debug.js:16 Running command: ga("create", "UA-XXXXXXXX-X", {cookieDomain: "auto", siteSpeedSampleRate: 10})
analytics_debug.js:16 Running command: ga("require", "displayfeatures")
analytics_debug.js:16 Running command: ga("set", "anonymizeIp", true)
analytics_debug.js:16 Running command: ga("set", "forceSSL", true)
analytics_debug.js:16 Running command: ga("send", "pageView")
analytics_debug.js:16 Registered new plugin: ga(provide, "render", Function)

标签: javascriptgoogle-analytics

解决方案


推荐阅读