Skip to main content

How to Track Page Load Time in Google Analytics

by Neil Goddard | 11.05.2011
Before Panda there was Caffeine, last year with the now not so recent Google Algorithm update ‘Caffeine’, page load time became a much publicised factor in how Google ranks it search results, the message was clear Google told everyone: REDUCE THE SIZE OF YOUR WEB PAGES.

To aid us all in our devoted missions to please Google, they have now introduced a site speed report in their Google Analytics tool enabling everyone to measure the page loading times of their website and diagnose where any issues lie. To enable the site speed report you will need to switch to the latest version of Google analytics and insert a small line in your tracking code.

You can find the Site Speed report in the newest version of Google Analytics under content reports.

Google analytics page load time

At the moment all your values should show 0 in the Page Load Time and Page Load Sample attributes of the report.  To enable Analytics to start tracking and recording data you will need to add a line of code to your Google Analytics tracking code:


See the following example with Page Load Time code installed, please note this is if you are using the Asynchronous tracking code (your tracking code is in your <head> section of your site):

 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-XXXXX-X']);

 (function() {
   var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
   ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www')
+ '';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

If you are using the older traditional tracking code you will need to add the following:

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "'

 var pageTracker = _gat._getTracker("UA-xxxxxx-x");
} catch(err) {}

You should start to receive data within a few hours.