Setup Google Analytics to Measure Page Load Time, Site Speed

By Posted 2011 Updated   BloggingGoogleTutorials

Google Analytics introduced a new feature which allows webmasters to measure Page Load Time and Site Speed and get detailed analytics reports for your site.

However, it is not an automatic upgrade, and webmasters, bloggers and site owners need to edit code of the Google Analytics code to start tracking page load time and get the site analytics reports. Though available in2 different scripts, it is advisable to always use the asynchronous script as it will not delay page loading and track more pageviews. Remember to place it in HEAD section of your page html.

Add Site Speed Analytics Code

To get the new site speed report, add the following line to your analytics code
_gaq.push(['_trackPageLoadTime']);

Now this is how your code will look like

<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>

Remember the page speed measurement is turned off by default and unless you make this code change to the Analytics tracking code, this report will not be generated. It will help you find which landing pages are slowest, find the causes and fix up your site speed issue as it is a search engine ranking criteria.


5 comments on “Setup Google Analytics to Measure Page Load Time, Site Speed

  1. Steven says:

    Thanks for this neat piece of coding. Am trying it out now and will see how things pan out.

    Thanks for sharing this around.

  2. Jimson Lee says:

    I installed the code, but I don’t see it in the reports yet. Where exactly does it show it?

    • QuickOnlineTips says:

      Go to the new version of Analytics – should see the link on top right. Click to Content > Site speed.

  3. arif says:

    very helpful tips.i didn’t know abot this tricks. thanks dude..

  4. Martin says:

    Thanks for this info. I couldn’t make head or tail of Google’s instructions and you set it out so simply. I have just installed it and Look forward to seeing the results.

    Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *




Next Article »
css.php