administration mode
Pssst...Ferdy is the creator of JungleDragon, an awesome wildlife community. Visit JungleDragon

 

Power tip: measuring site speed with just one line of code »

FERDY CHRISTANT - MAY 15, 2011 (07:46:39 AM)

I'm a long time user of Google Analytics. I've been using it on this site for over 5 years and it has become a default for me to install the Google Analytics tracking code on every new website I launch.

I'm a basic user though. I install it and occassionally check basic stats like visits and pageviews, and the general trend in traffic. This does not do justice to the true power of Analytics though. As I am taking traffic a lot more serious for JungleDragon, I am learning bits and pieces of what more Analytics can bring to the table.

Here's one of the those gems: Analytics can measure your site's load time. Think of that. You don't have to survey end users, set up test machines across the world, or write your own performance tracking code. All you need to do is this:

_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);

This is a partial snippet of a typical Google Analytics tracking code. The second line is what you need to add. That's all! Next, in Google Analytics you need to use the New Version of Analytics. There is a link to it in the header. In the new version, go to Content -> Site Speed:

I only enabled site speed tracking yesterday and allready today I am seeing the first results. Here's how this works: Analytics will sample page speed. This means that it will only track performance for about 10% of all traffic. In the example above, 7 people clicked on a JungleDragon link that I shared via JungleDragon's Twitter account. Of those 7 hits, Analytics took 1 site speed sample. The page in question took 4.53 seconds to load.

Awesome, isn't it? Of course, it requires a lot more page hits to start seeing meaningful results, this was just a test to see if this works. What is even more powerful is that you can include the site speed column into any segment of your choice. You can break it down geographically, to see if any region in the world is suffering from poor performance. You can see the efffect of browser choice on load time. How your site loads on a dialup connection. How mobile clients are doing. You can use any segment. With just one line of code. 

Want to know more, check the official help topic on site speed at Google Analytics.

Share |
RATE THIS CONTENT (OPTIONAL)
Was this document useful to you?
 
rating Awesome
rating Good
rating Average
rating Poor
rating Useless
CREATE A NEW COMMENT
required field
required field HTML is not allowed. Hyperlinks will automatically be converted.