简体   繁体   English

为什么页面加载时间0对于GA中的大多数页面?

[英]Why page Load time 0 for most of the pages in GA?

We are using google analytics in our application and getting strange results when tracking page load time. 我们在应用程序中使用谷歌分析,并在跟踪页面加载时间时得到奇怪的结果。 The data for most of the pages is 0 while few pages have the values. 大多数页面的数据为0,而少数页面具有值。 Now if we compare these pages with our qa sites , page load time has a value. 现在,如果我们将这些页面与我们的qa站点进行比较,页面加载时间就会有一个值。 Nothing has changed on these pages when we move to production except that we have a different tracking code and the application is available publicly. 当我们迁移到生产时,这些页面上没有任何变化,除了我们有不同的跟踪代码并且应用程序是公开的。 From screen shot below, you can see that we have data only for few days. 从下面的屏幕截图中,您可以看到我们只有几天的数据。

在此输入图像描述

I am not sure what is happening here. 我不确定这里发生了什么。 Any pointers will be appreciated. 任何指针将不胜感激。

This is our code 这是我们的代码

<script type="text/javascript">
(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');
ga('create', "my-google-analytics-code", 'auto');
ga('send', 'pageview', {'page': (location.pathname+location.search+location.hash)});
</script>

Site speed is only tracked on 1% of visitors by default so it's likely nothing has been recorded yet for those pages, you can increase this by editing the ga('create' part of your code 默认情况下,只有1%的访问者会跟踪网站速度,因此可能没有为这些网页记录任何内容,您可以通过编辑代码来增加这一点ga('create'代码的ga('create'部分)

ga('create', 'UA-XXXX-Y', {'siteSpeedSampleRate': 10})

https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#siteSpeedSampleRate https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#siteSpeedSampleRate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM