Articles in The 'code-migration' Tag


April 13 2009

The 6 Benefits of migrating to GA.js

by MoreVisibility

It’s official – urchin.js is not “going dark” anytime soon. However, that doesn’t mean that you shouldn’t upgrade your website’s Google Analytics Tracking Code to the newer, fresher, more dynamic GA.js tracking module. Sure, you can continue to use urchin.js and your data will still be collected and appear in your reports. However, there are not one, not two, but six benefits of spending a bit of time editing your footers, includes, or hard-coding your HTML source code to include the GA.js tracking script.

Let’s review these six great benefits one by one:

1. A Faster and Smaller Source File – Even though the actual sizes of the files are almost identical at 22.1 KB, the urchin.js file is over 600 lines long and is slower, less efficient. The ga.js file is a mere 41 lines long and is a very modern object-oriented tracking model. See them for yourself (Download urchin.js | Download ga.js). Think of this like you would think of two of the same car – for example – two Toyota Corollas, one from 1995 and the other from 2009. They both weigh about the same, but one is much more modern, environmentally sound, and better on gas than the other one.

2. Automatic detection of HTTPS – This saves a boatload of programming and coding time. Simply insert ga.js across all of your website’s pages without having to worry about coding differently for those secure pages that are being uploaded to the secure server. GA.js will automatically detect the protocol – urchin.js cannot do this unless you physically edit the tracking code.

3. Increased Namespace Safety – What this means in the most basic of layman’s terms is that ga.js does a better job in protecting your individual security (in terms of data) than urchin.js can. While ga.js never collects personally-identifiable information, such as zip codes or personal email addresses, it still needs a way to uniquely identify each visitor that accesses a website, which ga.js does in a safer way.

4. More convenient for tracking Ecommerce transactions – With ga.js, you can simply add the calls to _addTrans, _addItem, and _trackTrans right after the call to _trackPageview within the tracking code. There is no need for additional scripts or onLoad events like there is with urchin.js.

5. More customizable code for AJAX-based sites – The ga.js tracking code opens the door for “Web 2.0” websites that are loaded with videos, applets, widgets, and flash movies. This is almost not possible to do with urchin.js.

6. Take advantage of tracking functionality as it is added to Google Analytics – New, jazzy features such as Event Tracking can only be used if the website is using ga.js. The web is becoming less and less static with each passing day, and the need is increasing for being able to track actions on movies and flash games that are on many websites today. With urchin.js, this is not possible. Also, as new reports and sections are added to Google Analytics, you will need to be using ga.js to be able to take advantage of them.

Is migrating to urchin.js required? No, it is not. Is it highly recommended? Yes, positively it is.

© 2023 MoreVisibility. All rights reserved.