Track Page Load Time In Google Analytics

May 17, 2011

No Comments

Posted In : Uncategorized

Track Page Load Time

Google Analytics has come out with a new feature which is in direct correlation of their “Lets make the web faster” campaign. Now in Google Analytics you can measure page load time with the Site Speed feature. In order to make this work on your website you have to make a small change to the Google Analytics snippet code that is on your website.

site speed interface in Google Analytics

A traditional snippet looks like this:

var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘UA-XXXXX-X’]);
_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);
})()

This code is placed right before the closing head tag on a website. If you wish to install the new site speed feature in your website you have to simply add a line of code to you Google Analytics snippet which is:

_gaq.push([‘_trackPageLoadTime’]);

So now your Google Analytics snippet code will look like this:

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);
})();

Improve Page Load Time

The reason you will want to know how fast pages are loading is because if pages load to slow it may be a deterrent to not only search engine rankings but to users who do not want to wait for you web page to load. Those who have faster web pages on their websites have happier customers and Google takes this into consideration when ranking websites.

To IMPROVE page load times, you will either need a faster hosting service or will need professionals to look through your website code in order to find possible optimization that can be made to improve the execution time of the scripts on the page. Take a look at our lightning fast hosting packages in order to improve load times and Google rankings. If you are curious about possible optimization that could be made to your site, contact Innovation Simple for a free website analysis.

Contact Our Website Consultants

If you are in need of help with installing Google Analytics on your website and would also like help setting up the Site Speed tracking code on your website then please call us at 888-559-3274 and we would love to help you.

Trackback URI  |  Comments RSS

Leave a Reply