如何测量 GA 自定义变量的平均值?
我对 GA 的 _trackPageLoadTime 方法很感兴趣,因为它会记录到一个表中,该表显示平均加载时间以及页面浏览量、跳出率等其他因素(请参阅 甜屏幕截图)。
我想更进一步,做一些类似的超级简单的 JS 性能 - 开始跟踪 window.load 调用时间、图像加载前的延迟、昂贵页面的总执行时间等。
到目前为止,我'我在自定义变量中跟踪此信息,并且所有记录都很好 - 示例条目是“Window Load”,“2.67” - 但当然,GA 将它们视为离散值,这对于实际性能毫无用处。
有什么建议吗?是否有内置的 GA 方式来以这种方式查看我的数据,我可以尝试第三方方法......或者我需要通过 API 进行编程(也许使用 Garb Ruby gem) 提取这些数字并利用它们?
I'm intrigued by GA's _trackPageLoadTime method, because it logs into a table that shows average load time alongside other factors like pageviews, bounce rate, etc (see sweet screenshot).
I want to take it further and do something similar super-simple JS perf — start tracking things like the time window.load calls, the delay before an image loads, the total execution time of an expensive page, etc.
So far, I'm tracking this info in Custom Vars and it all records fine — an example entry would be "Window Load","2.67" — but of course, GA treats them as discrete values, which is useless for actual perf.
Any suggestions? Is there a built-in GA way for viewing my data this way, a third-party method I could try....or would I need to program something through the API (maybe with the Garb Ruby gem) to extract these numbers and make some use out of them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Google Analytics(分析)事件。这就是您要寻找的。您可以设置 3 个字符串参数和第四个数值。然后您可以看到总和值或平均值。
需要注意的一件事是它不适用于浮点数,仅适用于整数。因此,您可能想在您给出的示例中报告毫秒数。
Google Analytics Events. That's what you're looking for. You can set 3 string parameters and a fourth numeric value. Then you can see the total summed values or the average value.
One thing to notice is that it wont work with float, only integer numbers. So you may want to report milliseconds in that example that you gave.