Google Analytics’ New Site Speed Report Tracks Page Load Times

May 3rd, 2011 → 10:00 pm by Robert Kingston // 26 Comments

Update 24/11/2011: Now you don’t need to make the code updates for Site Speed Tracking – it is all controlled simply through _trackPageview(). In fact, now you can also control the sampling rate of site speed by calling _setSiteSpeedSampleRate() before the call to _trackPageview(). See the tracking reference here.

I’m not sure why, but I haven’t seen much coverage (none at all, in fact) about Google Analytics’ new Site Speed report. As you may have read on my blog, I covered Panalysis’ method to track page load times in GA once before and showed how page load times can be factored into insightful reporting. This time it’s different. Google has released an official product that measures page load times and I have to say, it looks great.

Google Analytics site speed graph

One graph you'll like to see decreasing... ;)

How it works

Rather than measuring only part of the picture, as other solutions do, it sounds as though Google measures page load times from the time the page was requested till all elements of the page have finished loading. For example:

  • Traditional methods: Document loaded, start tracking time, all objects loaded, stop tracking time
  • Google’s method: Page requested, start tracking time, document loaded, all objects loaded, stop tracking time

However, at the same time, it only records a sample of pageviews. In my experience, the sampling rate is set far too small to be useful for websites with a couple of thousand pageviews per month. Googler, Trevor Claiborne tells me that you can’t adjust the sampling rate of the _trackPageLoadTime() function “yet”…

So far, my guess is that it only samples 2% of pageviews, but we’ll have to wait and see as Google releases more documentation. Update: It samples 1 percent of supported browsers by default and the instructions for updating the sample rate are right below.

Click to see more details... you can quickly spot poorly performing pages (once you have a decent sample), fix them and improve the UX of your site

Why it’s good news

You’ll be able to quickly and easily monitor your site’s performance and how it impacts your website’s metrics. Check out my post on insights from tracking page load times here.

How to install it

This is the best bit – it requires no code. Forget setting up multiple tracking objects, custom variables, 10+ lines of JS code and figuring out how it all works. If you want to set the sample rate, just add the following line of script before _trackPageview:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXX-1']);
  _gaq.push(['_setSiteSpeedSampleRate', 5]);
  _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>

You can tweak this sample rate to a maximum of 10 percent.

Note that whilst this makes a request for __utm.gif, you won’t always see this, because of the sampling. Regardless, once you’ve accrued several hundred pageviews, you’ll start to get a little data.

This is just one of the exciting new features in GA’s new interface. I’m looking forward to the rest being rolled out. *Cough* Multi-channel funnels *Cough*

Check out Google’s help article here.


Share this post

Show it to your friends:


You Might Like These Posts Too

Subscribe to my blog for more great analytics and conversion optimisation tips.

26 Comments → “Google Analytics’ New Site Speed Report Tracks Page Load Times”


  1. Dan Cristo

    10 months ago

    Does anyone know if Omniture has this feature as well?
    Got to admit, it’s pretty slick. Hopefully they’ll come out with a way to track this without having to modify any code.

    Thanks for sharing the tip.
    Dan


  2. Rob Kingston

    10 months ago

    I don’t think Omniture does, but I can’t see why you couldn’t copy Google’s solution or a solution I covered on my blog and change it to use Omniture code.

    I think the tiny change required to the code is almost as good as not having to modify the code at all. I don’t think page load times are that important for a lot of websites (particularly those receiving <1000 visits / month), so by not tracking site speed by default, Google saves us from making unnecessary requests to their servers and increasing our sites’ latency.


  3. Philip Tellis

    10 months ago

    It’s hardly “Google’s method”. We’ve been doing this for a long time with boomerang: https://github.com/yahoo/boomerang/


  4. Rob Kingston

    10 months ago

    Thanks for the clarification, Philip. Will adjust the article when I get the chance.


  5. Theodor

    10 months ago

    Thank you for sharing this.


  6. Yasin

    10 months ago

    Great! Thanks for the hint! I will try it for sure! :)

  7. [...] Kingston wrote a great article on this topic and outlines that currently Google does not allow for sampling rates to be changed [...]

  8. [...] Die Seitenladezeit der Webseiten ist bekanntlich einer der vielen Faktoren, auf die sich das Suchmaschinenranking von Google stützt. Ganz einfach im Auge behalten können Webseitenbetreiber diesen Rankingfaktor mit Google Analytics. Notwendig ist dafür nur eine zusätzliche Zeile Code und schon erhält der Content-Bereich einen zusätzlichen Bericht, der zeigt, welche Seiten schneller und welche langsamer laden. Ein Howto dazu gibt es hier. [...]

  9. [...] 然而,网页分析专家罗伯特·金斯顿(Robert Kingston)却认为这个新的功能对于页面的取样率太低,对于中小网站来说很难得到有意义的数据。目前取样率还不能由用户自己设置,但是相信Google很快会做出改善。 [...]


  10. Kasper Bergholt

    10 months ago

    This is the first essentially useful feature I’ve come across with the new GA update.

    Does anyone know when Yoast’s GA plugin for WordPress will support the new SiteSpeed-tracking code?

    BR,

    Kasper


  11. Rob Kingston

    10 months ago

    If I had to guess, Yoast would be on this like white on rice.


  12. Kasper Bergholt

    10 months ago

    @Rob Kingston — Yoast has replied through Twitter that it’s on his to-do when he returns from holiday in a few days’ time.

    I’m really looking forward to see how GA stats compare to e.g. load times from Pingdom tools.


  13. Stephen Cronin

    10 months ago

    I’m sure Joost (ie Yoast) will add this to his plugin in the near future and other plugins will do this as well.

    I’ve actually written a post (How To Set Up Site Speed For Google Analytics In WordPress) about how to do this right now in both Joost’s plugin and in Ronald Heft’s Google Analyticator.

    They both have the ability to add custom code to the Google Analytics code.

    If you’re using Google Analyticator, it’s dead simple to do it. Joost’s plugin is a little more complicated and unfortunately you have to hack his plugin (because he’s not stripping slashes when adding the code to the page). I’d probably recommend waiting for Joost to update the plugin…

  14. [...] Numbers will not start appearing in your Analytics right away. According to this post by Optimisation Beacon, data will begin appearing after a few hundred [...]


  15. Ian Harte

    10 months ago

    This is killer! Can’t wait to get it fully implemented on all my sites! :]


  16. Marc Poulin

    10 months ago

    I am thrilled about this feature but quite disappointed with the sampling rate. So far, it is less than 1%. It may be OK for high volume sites but certainly not for most others. I wish there was a way to tweek that.


  17. Robert Kingston

    10 months ago

    @Marc, I was talking to a Googler who suggested they will allow us to change the sampling rate eventually. Let’s hope we see this hey…


  18. David Scheiner

    10 months ago

    My guess is that if they are only getting 2% of all traffic it is because they are using the window.performance object. This is only supported in IE9, Safari, newer versions of Firefox and Chrome. I’ve already written code on the commercial site I work on which gets this object and sends it back to our server where we store it in the database. This doesn’t strike me as anything revolutionary. Just an opportunity for google to store content that other people generate.

  19. [...] da imagem principal: Google Analytics’ New Site Speed Report Tracks Page Load Times Domicio Neto – SEODomicio Neto é Especialista SEO em Salvador, Web Analytics e SMO (Social [...]


  20. Robert Kingston

    10 months ago

    Thanks for the background David. Will check it out…

    Sure it’s not revolutionary to track page load times, but in the context of other metrics in GA, such as conversions, bounces and transaction values, I think it helps a great deal. For one, it helps establish the case for investing resources on site speed. Sure people already know the importance of site speed, but this gets the data in front of marketers and other decision makers so they can quantify it in dollars.


  21. Jen

    9 months ago

    In Drupal you can use the GA module and just add the snippet at the end.
    The module has a special box that caters for extra code.
    “Code in this textarea will be added after pageTracker._trackPageview().” -
    very easy becaus ethis is exactly where it should be placed.

  22. [...] Posted by admin at 1:56 pm development, Headlines, information, Technology Add commentsMay 292011Google Analytics’ New Site Speed Report Tracks Page Load Times | Optimisation BeaconShare this:FacebookStumbleUponDiggRedditSharePrintEmailLeave a Reply Cancel replyYou must be logged [...]


  23. Marko

    9 months ago

    Some issues and some fixes are gathered here: http://many.at/zwj79/


  24. Piers

    6 months ago

    Does anyone know if this feature has issues with being pulled through an iframe – just can get it to work…


  25. Dentist Plymouth

    22 hours ago

    going to have a look at my analytics right now and see if any of my pages load particularly slowly. Thanks for the information


Add Your Comment