10 Google Analytics Site Speed Tips

Google Analytics has a set of ‘speed’ reports, found under the the ‘Content’ left-hand navigation item. Here are 10 very quick “Google Analytics Site Speed” tips, collected together for ease of reading:

  1. All of the load speed data in Google Analytics is taken from users’ browsers themselves, so is fairly accurate.
  2. The browser stores all this speed data; Google Analytics then pulls that data at the point the code fires.
  3. Some browsers don’t support page load speed recording (notably Safari) so be very careful on ‘mobile’ speed.
  4. It’s tempting to pay attention to the top level “Avg. Page Load Time (sec)” metric that Google Analytics gives you. Slightly more useful than that: The ‘Distribution‘ report is tucked away behind a tab in the ‘Page Timings’ report. The distribution report is very useful, as you can see ‘% of pages loaded in less than X seconds’.
  5. ‘DOM Timings’ reports were added long after the main speed reports. They’re found in a similar area to the ‘distribution’ report, and are useful as they show how long it takes for your pages to become usable. (giving you ‘Avg. Document Interactive Time (sec)’ and ‘Avg. Document Content Loaded Time (sec)’ for each page).
  6. A big caveat: Google Analytics only tracks ‘page load speed’ for between 1-5% of pageviews as standard. You can fix that (see point 8).
  7. Because the sample size is so low, remember that ‘average’ page load speed is therefore affected if the speed of a page has only been recorded a few times.
  8. To improve the sample rate issue, you can add some extra code to your Google Analytics implementation. This essentially tells Google Analytics ‘try and collect page load speed data for 100% of page views’. Based on the earlier caveat that not all browsers support it, and the caveat that Google cap the total number of sessions they will record this for, you will never see a 100% sample rate, but if you are below that cap, this will increase it significantly. I have known sites achieve site speed data for 30% or more of pageviews, vs the default 1%. The code required to do this is as follows:
    • For older versions of Google Analytics (these will appear in your code as ‘ga.js’ or ‘dc.js’): _gaq.push([‘_setSiteSpeedSampleRate’, 100]); // this should go above the ‘trackpageview’ line in your Google Analytics code to improve accuracy
    • For newer versions of Google Analytics (these will appear in your code as ‘analytics.js’): ga(‘create’, ‘UA-XXXX-Y’, {‘siteSpeedSampleRate’: 100});
  9. If you’re looking for a good KPI on site speed, ‘% of pages loaded in less than 3 secs’ is a safe bet. (and ‘less than 7 seconds’ as a secondary).
  10. You may want to isolate that KPI further: ‘UK Only: % pages loaded in under 3 secs’ split by new vs return, for example.

I’ve done quite a bit of work with ‘Google Analytics Page Speed’ reports & have found them really useful, but with plenty of hidden caveats in the data. Feel free to ask any questions if I can help, & do share this with others if you think it would be useful.

5 Replies to “10 Google Analytics Site Speed Tips”

  1. Hi Dan,

    After changing the sampling rate, is there a way to test this using HTTP Fox or a similar tool? If not, can I expect to see some indication in the reports that the sampling is now at a higher rate?

    Derek

    1. hi, Derek!

      Yes, if you use a plugin for Chrome called ‘ga-debug’, opening up the developer tools console will then show that it’s taking place.

      Within Google Analytics itself, if you go to the site speed reports you can select a graph line showing ‘sample rate’, so should see that leap up if all has gone well.

      Thanks!

      dan

  2. Hi Dan-

    Thanks for these tips; great stuff.

    Question: where do I add the line _gaq.push([‘_setSiteSpeedSampleRate’, 100]); to my Analytics code? I can’t do it Analytics, and I’m running Google Analyticator on WP.

    Thanks!

  3. Hello,

    I’ve trying to fix page loading issues of my website. I am using google universal analytics. It shows me around 10 sec avg page loading time. Many times I think this data is not accurate because for some of the pages it shows 0 and for some more than 100, hows it possible! Also when I check those pages practically on browsers they load fast enough. So I am confused dont know whats right and wrong.

    Do you know how to fix this? I want to take it down to < 5 sec from 10 secs. How to do it?

    Thanks,
    Raj

Leave a Reply

Your email address will not be published. Required fields are marked *