Google and page load speed of your site

At the end of April of the current year Google Analytics representatives have announced in their official blog about launching of beta-testing of new interface, the overview of which can be read here.

In this article I want to share about the usage of its new interesting feature - analysis of speed of page load. It was officially declared several days later in the same blog.

Installation functions

On default page load speed tracking is turned off.

<citation from documentation>

In order to track reports on site load speed, it's necessary to make some changes in tracking code first. It's enough to embed one additioanal method:

_trackPageLoadTime();

Until you change tracking code appropriately, site load speed report indicators will have zero value on default.

Asynchronous code

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

Standard 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();
 pageTracker._trackPageLoadTime();
} catch(err) {}
</script>  

</citation from documentation>

If you use Google Analytics module for Drupal then in order to turn this function on it's enough to go to module settings (/admin/settings/googleanalytics) and in "Advanced settings" → "Custom javascript code" to add "pageTracker._trackPageLoadTime(); into "Code snippet (after)".

Data analysis

The first results will show up after several hours . To look them through, go to "Content" → "Site page speed" in your Google Analytics account.

Besides average statistics of all site (diagram) and of specific pages (report as a table) we can also make comparative reports relatively different parameters load. You must choose the parameter you are interested in at "Secondary dimension".

Now as an example we present reports of the main page of one of our portals during 24 hours...

Report of load speed regarding browsers

It's possible to make a conclusion that counting system is not ideal because it's obvious that Firefox and Safari calculation is not done...but that's what beta-versions are all about :)

Report of load speed regarding operation systems

It's evident that the system works only for Windows and Macintosh, though in my case it's >95% but still it's an offense for Linux.

Report on load speed regarding continents

In my case this was the most interesting report and it was the reason why I started investigation of the given topic. And it gave very interesting and unexpected results. The thing is that the server of the site that we give reports about is situated in Germany, CDN servers - in USA. It means that theoretically America should be lower in the list. However this is the food for thought and new multi-month experiments with different CDN providers :)

It's also not clear from the report whether Africa and Oceania don't use Windows or Macintosh, or they use exclusively Firefox and Safari, or Google for the unknown reasons can't analyze page load speed of such users... :)

Additional information can be found in the following article:

http://www.google.com/support/analyticshelp/bin/answer.py?hl=en&answer=1205784&topic=112071 ...)

WebMaster Tools

As a continuation of the topic I'd like to mention that Google provided information about load speed but not this kind of info and it looked differently.

If you go to "Google developer features" → mydomain.com → Diagnostics → Scan Statistics, then at graphic "Time spent for page load" dynamics of your site load by Google bots can be seen - roughly speaking time of html code generating and its delivery (Google Analytics considers all time: image load, css, scripts etc).

 

Interesting information can be found in Laboratory → Site performance:

Site load speed is a very important characteristics of the site both for search systems and for ordinary users. And though there was no ready-to-use solution for complex analysis of this issue, now we can declare with confidence that it appeared.

Viva Google! Viva Google Analytics!

Tags:
Google Analytics, Google WebMaster Tools, Page Load Speed