HOW TO: Setup Google Analytics To Check Site Speed

Google Analytics quite recently added a new feature for checking your site speed and page loading time, awesome isn’t it? It is not an automatic upgrade, so you need to tweak your Google Analytics default tracking code to enable this feature. Now it will be easy to improve your site’s loading speed.

Site Speed Google Analytics

Add Site Speed Code in Google Analytics

To get the new site speed report, add the following line to your analytics code


Now this is how your code will look like this [sample code] :

<script type=”text/javascript”>
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);

This will be really useful for webmasters and bloggers to detect which landing pages are slow. Also you can find the cause and fix it earlier since Google considers site loading speed as a key factor in SERPs.

9 thoughts on “HOW TO: Setup Google Analytics To Check Site Speed”

  1. I think the line "_gaq.push(['_trackPageLoadTime']);" is added to the code by default. I checked my source code and it's already there. Maybe I updated the code once upon a time !

  2. While updating the code, I realized I was using the old analytics code. Updated to the new one and also added the above mentioned line of code. Thanks Pradeep. πŸ™‚

  3. Thank you so much Pradeep for given here πŸ™‚ And, this is one of the best directions to increase your web site loading speed πŸ™‚ Great code πŸ™‚

  4. Thanks Pradeep, till know i was checking it through Google Webmaster tool, will now integrate This Code !

  5. Thanks for this.I didn't know about this.I've added this code.I'm going to check how fast my site loads.


Leave a Comment