Measuring User Load Time: New Google Analytics Feature

You may have noticed that the Google Analytics team have been very busy over the past few weeks, pushing out updates to all accounts. The latest addition is to the Site Speed area, where you can see a collection of page loading times on a per user basis rather than en masse.

So how is this different from before? Well, the old way that data was collected was via a random sampling of 10% of your site’s visitors. As in, Analytics would measure the page loading time of 1 in 10 visitors to your site for each page. So essentially, what could happen was that visitor A who is on a shared 56k modem connection was timed for your homepage, and a uni student on their University’s 100mb+ connection was measured for Page B.

This obviously creates a bit of an imbalance in terms of the data that is reported, but this new update seems to be about picking one user and timing all their visits until they leave the site. If this is what it seems to be, then it represents a massive step forward in terms of getting consistent accurate data throughout Analytics.

Unfortunately, Google’s current documentation on how to implement this tracking is sorely lacking on its help page, which can be viewed here. (EDIT: The implementation documentation has since been added.)

So I’ll show you here how to build your own. The following example tracks how long it takes our Jquery Library to load from our Google CDN.

_gaq.push([‘_trackTiming’ < – This tells Analytics to add a time to our reports.

,’jQuery’, < – This tells Analytics we want to call this time Jquery.

,’Load Library’, < – Here we can give a more specific label , which I’m choosing to call this the ‘Load Library’.

,20, < – The time you’re adding to the reports (Note: you have to calculate this yourself).

,’Google CDN’, < – Optional: Lets you segment and label even further (so we know this particular one is from the Google CDN)

Aris works deep inside E-Web's R & D bunker on top secret and presumably dangerous projects. When he's not being tightlipped about what he's up to, he can be found giving away trade secrets if you buy him a beer.