Small site? Raise your page load time calculation sample to 100%

A quick post about a new feature Google released quietly: it's possible to raise your site speed sample rate from 10% to 100% if you want. Especially small sites can take advantage of this. How often have you seen this:

A very low sample of pageviews where a page load time calculation is done. This leads to a very bumpy graph in actual page load times. And that is very annoying if you want to analyze your "bring my page load time down" efforts, You can only significantly say something about it if you have at least a week of data. And we all want to see results right away ;)

But now Google has provided a way to set this samplerate higher than the default 1% or the max 10% you could set before. Add this to your Google Analytics code (between the setAccount and the trackPageview):

_gaq.push(['_setSiteSpeedSampleRate', 100]);

In the past you could raise your sample rate to a max of 10% (for max 10K pageviews), but now you can raise it to 100% (also probably maxed at 10K). I used 99% for a while in my tracking code, so I'm seeing this in my sample rate graph:

The dark blue line is the sample size, the light blue my pageviews. You can see more pageviews are used to calculate average page load time.

Click to activate social bookmarks

 
  • Rob

    Is there a delay involved somewhere? I changed it to 100% on a site with 60-70 daily visits, but no change in the page load sample is noticeable. Yesterday, for example, was quiet with only 45 visitors, but for some reason the page load sample is 1.

    • http://andrescholten.net André

      There's no delay. But it could be that most of your visitors use Internet Explorer? Not all browsers support this page load measurment at the moment.

      • Rob

        Internet Explorer fortunately accounts for a mere 33%. According to the Google Analytics help pages, however, _setSiteSpeedSampleRate needs to be called before _trackPageview in order to be effective, so that's probably what will fix this for me. Something to add to your instructions above, perhaps?

  • Rob

    I see an extra HTTP request to __utm.gif now, so it's probably working.

    • http://andrescholten.net André

      Yes, than it's working ;)

  • De Linkbuilder

    Do you have a good advies on how you can make a magento shop runner quicker. Loadtime at the moment on my webshop is so long at the moment but I can't find the bug..

  • http://www.edelsteenkralen.nl/ Armande Kralen

    Great advice, immediately raised the limit to 100%, thanks.

  • http://sql-formatter.com Doug

    I'm a bit ashamed to admit it, but I didn't even know GA tracked website loading speed. Now I realise one of my websites that I thought was a bit slow is actually *very* slow. I'm glad I found this post.

  • http://andrescholten.net/ André Scholten

    No problem ;)