Should I Update my Google Analytics Tracking Code?

January 7, 2008

With the recent release of the ga.js code many people in the Analytics world or who have it running on their respective websites may be wondering “Should I update my Google Analytics Tracking Code? The simple answer is “Yes” because you won’t need to worry about updating it in 12 to 18 months from now when support finishes in the urchin.js code.

Other reasons to update your Google Analytics Tracking Code include…

  • A smaller and faster source file for the Google Analytics Tracking Code
  • Use of Object Oriented structure
  • Automatic detection of HTTPS

How do I make the change to my Google Analytics Tracking Code?

1. Pull up the source files (PHP, ASP/ASP.NET or XHTML/HTML) and find the tracking code that is on the page. It should look something like this…

<script src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>

</script>

<script type=”text/javascript”>

_uacct = “UA-XXXXXXX-X”;

urchinTracker();

</script>

2. Copy and paste this code over the original code shown above with this new code which you can get from your Google Analytics account (see my article on installing a Google Analytics Tracking Code if you have questions or contact me directly today)

3. Upload the file(s) to your site and start enjoying the new and improved ga.js source on your site

Feel free to download a copy of Google’s Official Migration Guide to this new tracking code or get in touch with a professional (like myself) that can help you install it and ensure its working on your website. If you do decide to switch from urchin.js to ga.js now or in the future you’ll need to re-program any Google Analytics custom functions and methods you’ve setup to work with the new ga.js functionality so feel free to contact me if you need help doing this.

Luc

Google Analytics Guy

Related Articles:

Comments

Got something to say?





*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation