Non-blocking Google Analytics
19 March 2009A lot people us Google Analytics for their web tracking. Just include the little bit of javascript at the bottom of the page and you get all those fancy graphs and whatnot.
This is fine except for a few things. If you have any other javascript on your page that is waiting for the DOM to finish loading then it will wait. Wait until the GA code has finished downloading. This can be a pain for things like javascript tabs or accordians etc. These types of UI features won’t look right until GA has finished loading.
By enabling GA loading to not block this other content your pages will load quickly and yet still get the GA candy. I have just installed the code from 925 HTML on to several of my existing sites and those that I manage. This is a cleaner implementation than what I had already.
« Halevt, a nice replacement for ivman Hosting your own OpenID with Nginx, SimpleID and Yadis »Possibly Similar Pages
- Non-blocking Google Analytics Revisited 2009-05-11
- Reducing HTTP requests using data URLs to increase performance 2009-12-18
- Javascript and IE7 2009-11-26
Comments on this post
blog comments powered by Disqus