Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 974
Slim514 Avatar asked Mar 27 '12 16:03

Slim514


2 Answers

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?

like image 92
Tim Avatar answered Sep 29 '22 23:09

Tim


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 i.e. Chrome, Friefox, IE9

like image 20
Andy Davies Avatar answered Sep 30 '22 00:09

Andy Davies