Thursday, September 2, 2010

Update Your Google Analytics Code and Enjoy Some Added Benefits

Last December, Google updated their Analytics code to the new and improved "asynchronous tracking code" with some added benefits, including faster tracking code load times, improved accuracy, and the elimination of tracking errors caused when JavaScript doesn't fully load. It also simplifies the ability to track multiple subdomains within a single profile. This is reason enough to update you code.

As of a few weeks ago, there is added incentive to updating your code. You can now use the new asynchronous code to save time with other Google products, such as Google Webmaster Tools. In the past, you would have to generate code to track web analytics and insert it on your webpages. In order to verify site ownership in your Google Webmaster Tools account, you would have to add an additional line of code to your website. Seems like a wasted effort. Not anymore, though. You can now save yourself a step and use your Google Analytics tracking code to verify your Webmaster Tools account.

If you haven't already updated to the new asynchronous tracking code, here's how:
  1. Remove all existing code from your website first. If any of the old code remains, it will likely skew your data.
  2. Copy the new code from your Profile Settings screen in Google Analytics by clicking on the "Edit" button in the Analytics settings, then clicking the "Check Status" link.
  3. Paste the new code in the section of each page of your website you want to track. Specifically, the code should be the last thing before the tag. Note that the old Analytics code resided in the section. Not anymore.