javascript - 谷歌分析没有收集任何网站速度数据
问题描述
我正在使用analytics.js
Google 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)
解决方案
推荐阅读
- python - 通过 for 循环用用户输入填充列表
- r - 为什么训练数据上的线性回归拟合值和预测值存在差异?
- firebase-authentication - 托管公司托管的域上的 Firebase Web 登录?
- vue.js - 如何对 vue 中的变量进行单元测试并用 jest 进行 vuetify?
- matlab - matlab在线脚本中如何取消注释代码
- mysql - 如何在 MySQL Workbench 8.0 中加载本地数据?
- php - 如何在路由laravel中传递两个不同的ID?
- reactjs - 我的反应应用程序未按预期呈现。为什么会这样?
- z3py - How to get result from z3py calculation?
- python - 在 Pycharm 上安装 xgboost 时出现问题