简体   繁体   中英

Google Analytics: Site Speed average always at 0.00

I have the following code (obviously the XX has a real number):

<script type="text/javascript">
    var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-XXXXXX-XX']);
   _gaq.push(['_setSiteSpeedSampleRate', 10]);
  _gaq.push(['_trackPageview']);

  (function() {
     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

I have an average of 1000 hits per day. Yet, I see the average load time speed at 0 sec for all pages. I integrated this 2 weeks ago.

I do not have _setSiteSpeedSampleRate set with my GA code, but I do have all the stats in my reports. You may want to remove it entirely.

See this post for a more detailed answer about how _setSiteSpeedSampleRate used to work: How does _gaq.push(['_trackPageLoadTime']) work?

You can set the sample rate to 100% and Google Analytics will then keep as amny samples as it can.

What browsers are you seeing visit your site - Site Speed only works with browsers that support the Navigation Timing API ie Chrome, Friefox, IE9

Your tracking code looks fine. As Andy already mentioned, you can set your sampling rate to 100%, since the overall amount of traffic you're seeing is below 10K visits/day. To do so, simply change the 10 to 100 in the second _gaq.push .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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