Saturday, February 05, 2011

How fast is my site? : Integrating boomerang with google analytics

Site speed matters. Period!!

Here is a statistic to drive home this point: For a 100ms(millisecond) delay in pageload of Amazon, sales decreased by 1%

Through this post, I want to share an approach to figuring out: How fast is my site?

Step1:
Install YSlow/Pagespeed : Two wonderful tools to find what is happening behind the scenes to render a web page, how fast is it on your computer.

But, the problem is... The data we can get from these tools is limited/biased.
How can we collect data of every consumer visiting your site?

Step2:
Boomerang is a beautiful tool from the Yahoo! Stable (YDN). It measures how much time a page takes to load for every visitor of your site (well, almost...)

But, the problem is... We have to write a lot of scripts to parse the webserver logs and analyze this data.
How can we be lazy/smart to analyze this data?

Step3:
Integrate google analytics (event tracking api) with boomerang using this code snippet:
https://gist.github.com/833066
The piece of code above will create a report of the page load time of different pages in your analytics account (goto: Content->Event Tracking)



The last column will tell you the average page load time.

Each line/variable of the code has been thought through and tuned to get the reporting right. Hope you will find the code/ideas useful.

Now, Lets make web faster...

No comments: