Google’s Need for Speed Hits Analytics


This seems to have gone fairly unnoticed, but Google has started including site speed metrics in Google Analytics. For web professionals like us, this is awesome, because Analytics is easy to gain and share access for reports and planning.  So this cool new feature comes with a very small bit of work…. You have to add the tracking snip.

For the old GA you will add pageTracker._trackPageLoadTime(); like this
<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>
For the new Asynchronous code you will add  _gaq.push([‘_trackPageLoadTime’]); like this
<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>

 

Nice indeed. Once you set this up in about 24 hours you will begin to see data trickling in the content >> site speed report area of your Analytics dash. Google notes that probably should only tag a few pages, but the whole damn web is dynamic and so is my solution. Tag them all and let Google sort them out!

I really like the default selections of metrics for the new site speed report. They are all related relevant and insightful. Probably will even keep me from needing a custom speed report for a few months.

The default view of the Site Speed report shows Pages (your website pages) as the primary dimension. It lists your pages in order from those with the highest latency to those with the lowest. In this view, you get the following metrics in the report table:

  • Avg Page Load Time—the average amount of time (in seconds) it takes that page to load, from initiation of the pageview (e.g. click on a page link) to load completion in the browser.
  • Pageviews—The actual number of times the page was viewed for the selected date range.
  • Page Load Sample—The actual number of pageviews that were sampled to calculate the average page load time.
  • Bounce Rate—As for Pages report, the percentage of views to this page in which this page was the only one viewed for the session.
  • % Exit—As for the Pages report, the percentage of views to this page in which this page was the last page in the session.

One thing to note is that this method of tracking/monitoring your PageSpeed score is far more useful than the snapshots we check ourselves. What are people in other geographical areas getting? Does your server have a very slow period you didn’t know about? Dang, my site is that slow in Safari?

Google’s quest and passion for speed suits me just fine, as I’m about as impatient as they come! Get on board and start thinking speed as part of your maintenance, growth plan and SEO… Google does!