Google Demands Speed & Helps with Asynchronous Analytics Tracking

Est. Reading Time: 4 minutes

Though it has been released for over a year now (December 2009) it is worth stating — or restating — that if you use Google Analytics for your website statistics, you should migrate to their Asynchronous Analytics Tracking script and away from their traditional Javascript library or the original Urchin script. For background, see:

Benefits of a Faster Site

  1. A faster site improves your user experience.
  2. Your site SERP Ranking (Search Engine Results Page) improves.

A Short Back Story

Urchin was purchased by Google in early 2005 and Google Analytics was rolled out a few months later, largely based on “Urchin On Demand.”  The Urchin tracker is still supported by Google, as is Google’s traditional Javascript GA script. Unfortunately, both are rather large and synchronous — they have to load before page analytics start to be tracked or other events occur. This is why Google has always recommended that you load Urchin or the traditional script at the bottom of the document.

The Downsides to Synchronous Loading

The Need For Speed

It used to be that the best practice on website design was small images and lean, clean website pages on a fast server so that they loaded quickly over dialup, on slower computers.  Much of this ideal fell by the wayside in the past ten years as code for sites became more robust and had better features, but came at a cost:

All of the reasons listed above can penalize your search engine rankings on Google, and even how often Google or other search engines bother to index your site. This article isn’t about poor website design or substandard hosting (that’s for another time) but with all of these ways that you can hurt your site, adding to it by continuing to use Google’s traditional script only compounds the problem.

Faster is better, and Google has for some time now factored how fast your site loads into its ranking algorithm.

Because of this renewed importance of page load speed for Google they realized that these large load time libraries were counterproductive to the internet and their own goal to reward speed in search engine rankings.

During 2009 they developed an AJAX, or asynchronous, script that would become the Google Analytics Queue object, or _gaq.  This object is used to asynchronously load the Google Analytics library in the background, AJAX-style.

This switch frees up your pages to finish loading, loading faster, queue up events or commands to execute after the library loads, and better push events on your page into Google Analytics.  You have the ability to push all of the traditional metrics you might use into Google Analytics asynchronously, plus it is now easier to create virtual events or pages and push data into GA for later use.

I would suggest as good reading an excellent reminder article about page speed and user experience from Jakob Nielsen, one of the foremost authorities on User Interface Design and User Experience.  Switch to the asynchronous script, and keep your site lean. It will benefit your users, and your rankings.