Upgrading Your Site From urchin.js to analytics.js

If you’re an Urchin customer, you can migrate your Urchin data to Angelfish Software.

There has been some hullabaloo about how long Google will continue supporting urchin.js, the older version of the Google Analytics tracking code. It was marked as deprecated some time ago, and Google stopped making updates to it to encourage customers to “upgrade” to ga.js and analytics.js.

However, it should be noted that some of Google’s own sites still use urchin.js. As do many very large websites. Google has been very clear that there are no plans to drop the code–especially not without warning.

Regardless, we recommend upgrading to the newest version of the code. We also recommend keeping a backup copy of the tracking data sent to Google. If your company doesn’t already do this, start today – it’s free!

Advantages to newer code

There are some clear advantages to using the newer code, however. And those advantages will only multiply with time.

  1. Access to new and also upcoming features, like Event Tracking
  2. Smaller file size means faster downloads
  3. Automatic detection of HTTPS
  4. Increased namespace safety
  5. Object-oriented code is more flexible in many ways
    • Easier e-commerce setup
    • If you’re using multiple accounts or profiles, more control over what data gets sent to which profiles
    • Rename or create multiple tracker objects
  6. Higher data collection thresholds
  7. Asynchronous JavaScript

If you update the code correctly, no data will be lost. The newer code doesn’t change how visit data is collected or calculated. It provides all the benefits without any drawbacks besides the pain of changing the code once.

Replacing urchin.js

Depending on how your site is set up, making the switch will be very easy.

First, log into your Google Analytics account.

From the Analytics Settings page (the one listing your profiles), click Edit next to the profile for the website you are upgrading.

On this page, you will see a box titled “Main Website Profile Information”. Just above this box, in the right hand corner is a little link that says “Check status”. Clicking this link will give you the most updated version of the tracking code.

If you haven’t done any modifications to your code, you can simply replace your current code with this code. Make sure you get every page! The two versions don’t always play nicely with each other.

Modifying analytics.js

If you have made any modifications to your tracking code, making this upgrade becomes a little bit more complicated. With urchin.js, you primarily just set different values for variables. In analytics.js, you call methods of the trackPageview() object instead.

Next Steps

Check out our Recommended Tools to learn about products that complement Google Analytics.

Google Analytics for Intranets

Does your company use Google Analytics to track Intranet websites? If so, there’s a slight problem:

Google Analytics isn’t designed for Intranets