Finding Great Web Hosting

Thoughts On The Best Web Hosting I Have Found...

Using Google’s New Asynchronous Tracking

Recently Google has made a new form of their tracking available that should provide some better performance. Normally a webpage can experience slowdown while downloading or executing JavaScript (which is what the Google tracking uses). To be more correct, any time you are loading something from another domain you do run the risk of having it introduce itself as a bottleneck for your page speed.

I have always found Google’s tracking code to be fast, definitely faster than other tracking applications I’ve tried. Still, if they can improve the performance even further I won’t turn it away.

Installing Google’s New Tracking

I found that just relocating the tracking page was a little tricky…not sure why they hide it the way they do. Anyway, here are the steps to install the new (and potentially faster) Google tracking:

  1. Log into your Google Analytics account

  2. You should be provided a list of sites you are tracking. Find the site you want to change.
  3. You should see your site URL and then an identifier that looks like this: UA-1234567-8. Write this identifier down (it is your sites Web Property ID).
  4. Click the Edit link.
  5. In the upper-right of the page that has loaded you should see a link “Check Status”. Click on this.
    google analytics: check status

  6. You should now see a new link in the section titled “Instructions for Adding Tracking” that says something like “Try the new Asynchronous Tracking!” – click on this.
    Note: at some point this new feature will likely become a standard feature so this link may be moved or changed but accessing the tracking code should still be available at this page

  7. You should now be presented with the page to access the new code. At this time, you have to manually enter your Web Property ID (which is why we wrote it down earlier). I imagine they will at sometime change this so the code presented to you will already have your ID in it.
  8. Copy the tracking code text.
  9. Find where you keep your old Google tracking code (for example, in WordPress this is normally in the footer.php in your theme).
  10. Remove the old Google tracking code and replace it with the new
  11. Remember: You will need to update the Web Property ID. The line you need to change looks like this:
    _gaq.push(['_setAccount', 'UA-XXXXX-X']);
    So on this line you would replace UA-XXXXX-X with UA-1234567-8 (using the example code from above)

  12. Save the file you’ve changed and ensure the changes are copied to your web server.

The process is relatively simple, although I do think Google should just be populating the Web Property ID themselves. Seems likely to me that many people will see the new code and replace their old code with it without ever reading that they need to replace the UA-XXXXX-X.

What Does Asynchronous Mean?

Normally, when a web page hits some JavaScript it has to wait for it to download before it can move on. This is why people try to put much of the JavaScript at the bottom of their web pages: this way, it is creating the slowdown after everything else has been loaded and hopefully the user won’t notice the slowdown. Asynchronous just means that the web page will continue to load other items even when it hits this piece of JavaScript. Not only should this improve performance, it means you can put this piece of JavaScript anywhere you want instead of the bottom of the page.

Additional Reading: