gpt4 book ai didi

javascript - 为什么 User Timing 数据没有显示在 Google Analytics 中?

转载 作者:行者123 更新时间:2023-11-30 00:17:08 24 4
gpt4 key购买 nike

我正在尝试将 User Timings 数据添加到已运行 Google Analytics 的现有网站。它似乎已正确提交,但它没有显示在 Google Analytics 仪表板中。我不知道如何进一步调试它...我被卡住了!

请参阅以下 HTML 示例。在这个例子中,我试图提交一个“事件”和一个“时间”。结果:事件成功了!但时间并未显示在 Google Analytics 中。

<html>
<head>
<script>
function universalAnalyticsPush() {
if (!window.ga) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

window.ga('create', 'UA-xxxxxx-xx', 'auto');
}

window.ga.apply(window.ga, arguments);
}

universalAnalyticsPush('send', {
'hitType': 'event',
'eventCategory': 'test-corey-blobby-event',
'eventAction': 'test-corey-marks',
'eventLabel': 'geronimo',
'eventValue': 33,
});

universalAnalyticsPush('send', {
'hitType': 'timing',
'timingCategory': 'test-corey-submission',
'timingVar': 'test-corey-variation',
'timingValue': 172,
});
</script>
</head>
<body>
<p>Something.</p>
</body>
</html>

查看 Google Tag Assistant,事件和时机似乎都很好:

event data is submitting timing data is submitting

现在,如果我们在 Google Analytics 中查看 Reports -> Real Time -> Events,事件就会出现,看起来很棒:

Google Analytics view of Real Time Events

但是没有用户计时数据(或者我没有在正确的地方寻找它):

Google Analytics view of User Timings

我的 javascript 似乎没有任何错误。我收到的唯一警告是使用 Google Analytics Debugger:

View of the Console with 1 warning, no errors

并且 Chrome 的 WebView 表明跟踪调用正在成功发生:

Chrome got 200 OK on both the event and the timing submissions

那么....为什么 Google Analytics 会忽略我的计时数据?

最佳答案

您正在使用将显示当前数据的实时事件报告,但用户计时报告不是实时可用的。您需要等待数据可用(4-6 小时),然后再回来查看。您正在查看的用户计时报告是正确的。

与此同时,我可能会读到有关 sampling rate for User Timings 的信息.我怀疑它是否会影响您的数据,但它是需要考虑修改或只是一般性理解的东西。

希望对您有所帮助!

关于javascript - 为什么 User Timing 数据没有显示在 Google Analytics 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34326123/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com