Track site speed in Google Analytics

Site performance should always be one as you main concerns as a site owner or webmaster. Great site speed can improve SEO, increase conversion rates and reduce bounce rates.

With the new version of Google Analytics, you can now easily follow the site speed of your site.

All that’s needed is adding a few lines of code in your Google Analytics tracking code and then you’re up and running.

Implementation

Implementing the site speed code is very easy – you just need to update your Google analytics to the latest version of the tracking code, and ensure that the “trackPageLoadTime()” is included in the javascript.

Google Analytics provides both a asynchronous  and traditional javascript code.

Asynchronous Code (default)


<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
(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>

Traditional code


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

"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
<strong>pageTracker._trackPageLoadTime();</strong>
} catch(err) {}
</script>

New report

When the tracking is implemented, Google Analytics starts measuring download speed on each page of your site. The results is presented in a new report (content->Site Speed) in the new version of Google Analytics. The reports shows useful metrics like average download time, bounce rate, sample size and page views.

The new site speed report in Google Analytics

With these metrics at hand, you can easily see which pages on your site that might need a little optimization.

Conclusion

Implementing the new Google Analytics tags is normally a very easy task, and when you consider the benefit – a very useful report for optimizing your site – our clear recommendation is to update the Google Analytics tags ASAP.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
fold-left fold-right
About the author
Jørgen Nicolaisen has been passionately interested in everything online since 1995. His experience is based on working with small hobby projects as well as high volume websites. Jørgen is currently focused on the PHP based programming framework - Codeigniter, and WordPress naturally

One Reply to Track site speed in Google Analytics

  1. thats really great.. i m checking speed of my blog.

Comments are now closed for this article.