ghacks Technology News

Speed Up Google Analytics

Several webmasters that I have talked to in the last year expressed their concern about Google’s website traffic analyzer Google Analytics. Once of the complaints was that the Analytics script would slow down the loading of the website. Some even moved to other web tracking scripts to make their websites load faster.

Everton over at Connected Internet has now spotted an alternative code to the standard code that has to be added to the website. The alternative is also provided by Google and currently a beta. The main change to the generic code is that it uses asynchronous tracking which basically optimized the way the web browser loads the Google Analytics code.

google_analytics

Another difference is that the asynchronous code has to be placecd at the end of the HTML head tag opposed to the standard code which is placed at the end of the body tag.

The new Google Analytics tracking snippet offers the following benefits:

  • Faster tracking code load times for your web pages due to improved browser execution
  • Enhanced data collection and accuracy
  • Elimination of tracking errors from dependencies when the JavaScript hasn’t fully loaded

Just visit the Google Code page where the basic code for the asynchronous script is posted. All that needs to be done is to add this before the head tag and replace the UA-XXXXX-X with the code for that website (this can be found in the old code). It is also important to remove the old code from the website as it is not recommended to run both codes on the same website.

Related Articles:

Google Analytics Opt-out Browser Add-on
Prevent Google Analytics from tracking your visit
How To Track Google Keyword Rankings In Google Analytics
Why I disabled Google Analytics and WP-Cache
Google Analytics Intelligence

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook, Twitter or Google+ using the icons below.



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Wednesday December 2, 2009 -
Tags:,


Responses so far:

  1. Tun says:

    I believe most people have already blocked google analytics on their computers using ‘no script’ due to it being too slow since day one. so the systems already killed its self off and useless.

  2. hak01 says:

    “hey it’s amazing

  3. Diego says:

    @Tun
    That’s exactly what I’ve done!

    Now I have to wait all sites over the world change their code…
    I think that kind of scripts should be dynamic, so any change will be reflected in any site.
    Could Javascript do that?

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us