Upgrading Your Site From urchin.js to ga.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 timeago, and Google stopped making updates to it to encourage customers to "upgrade" to ga.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 of your Google Analytics data. If your company doesn't already do this, start today!
Advantages to ga.js
There are some clear advantages to using the newer code, however. And those advantages will only multiply with time.
- Access to new and also upcoming features, like Event Tracking
- Smaller file size means faster downloads
- Automatic detection of HTTPS
- Increased namespace safety
- 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
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.
Switching from urchin.js to ga.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.
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 ga.js, you call methods of the pageTracker object instead.
Below are some common modifications and their equivalents in ga.js. Please note that all ga.js equivalents are methods of the tracker object. They are not stand-alone functions! Example: _link() must be called as pageTracker._link().