The ROI Revolution Blog

« Goal Matching Revisited | Main | Some Thoughts on Exit Rate and Bounce Rate »

Should You Join the Migration? urchin.js Migrates to ga.js

January 4, 2008

Should I Migrate to New Google Analytics Script?

In mid-October Google announced the beta release of the new tracking code: ga.js. Then, in December, they released the new code to all Google Analytics users. So you might have noticed, within Google Analytics, that there is now a tab labeled 'New Tracking Code' within the Profile Settings > Tracking Code section.

You may be thinking, "Why should I care?" Well, here are a few reasons why the migration to ga.js is practically inevitable for those of you who want to remain on the cutting edge of the latest and greatest technology. And why, for those of you who don't want to rock the boat, it may not be necessary to switch over... yet.

With the upgrade to ga.js you will have access to several new features including Event Tracking, and Outbound Link Tracking.

Event Tracking will be especially useful for those who have Flash based sites, or for those who use multimedia on their site. An "event" is an action that a user takes on a webpage that doesn't necessarily involve a new pageview. Examples include clicks on buttons or images, navigation in embedded Flash, or Ajax events, like moving a map in Google Maps, or applying a label in Gmail.

Outbound Link Tracking will tell you which links visitors clicked on your site that direct them to another site without the manual tagging. This means that instead of adding urchinTracker to each and every one of your outbound links to see where visitors are going once they leave, you don't have to do anything.

A few other benefits of the updated ga.js include:

One question seems to keep surfacing about the migration, so I will go ahead and address that now. The new Google Analytics tracking code (ga.js) will NOT work with the previous tracking code (urchin.js). They are not compatible, so all pages on your site should be updated with the new code.

So the bottom line: Should you switch to ga.js?

Google is still supporting the urchin.js tracking code, and sources predict that that they'll continue support for another 12-18 months, so if you're happy with the current features and you're not worried about any new releases to ga.js (and the potential discontinuation of support down the line), then you're probably OK for another few months, at least. Eventually, though, you're going to need to switch to ga.js.

If you want event tracking and automatic outbound link tracking, as well as any new features that are released in the future, and you're willing to spend a little time and resources on getting everything set up properly, then you might want to consider joining the migration.

If you're looking for help, Google has written a reference guide for switching over to the code in pdf format, and if you need any assistance from ROI Revolution, an Authorized Google Analytics support partner, be sure to take a look at our Google Analytics support plans and we'll get you on the path to a seamless migration.


Interested in learning more about Google Analytics?
Attend our LIVE Google Analytics Seminars for Success training in Atlanta, GA Wednesday, April 14th, 2010 and Thursday, April 15th, 2010 or get the latest tips and tricks sent to you via our free, twice-monthly Google Analytics newsletter.

Comments

Joost de Valk said:

My plugin for WordPress already uses the new tracking code, making switching one of the easiest jobs ever. It also allows for a few other tricks like tracking image search queries and outbound clicks, and will be using events as soon as they're out of beta.

January 7, 2008 2:01 PM

Dennis Gorelik said:

Would astrack.js (http://www.seobook.com/archives/001370.shtml) work with ga.js?

It seems it won't, because at its core astrack.js calls urchinTracker('/asclick');

Is there AdSense Google Analytics tracking script available that is compatible with ga.js?

January 7, 2008 5:42 PM

Adam said:

hold on, i swear it says in GA that you can have both implementations on a site, just not on the same page.. ?

January 7, 2008 8:19 PM

David Burke said:

Can you provide some clarity on using the new ga.js code in a "3rd party cart" situation?

There are some differences in the approach suggested by the "Migration Guide" and the Google Analytics help page on the subject.

For the GATC, the Migration Guide (pg. 9) recommends adding:
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);

while the Help page "separate store site" example suggests:
pageTracker._setDomainName("mystore.com");

My guess is that the PDF has the correct code. Can you confirm?

For the link to the 3rd party cart, again 2 methods are described.

The Migration Guide:
<a href="http://newsite.com/test.html" onclick="pageTracker._link('http://newsite.com/test.html'); return false;">click me</a>

The Help page:
<script type="text/javascript">
document.write(
'<a href="javascript:pageTracker._link (\'https://www.securecart.com/?store=parameters\');">Purchase Now</a>'
);
</script>
<noscript>
<a href="https://www.securecart.com/? store=parameters">Purchase Now</a>
</noscript>

Here my guess is that the Help file is correct. Again: Can you confirm the "correct way?"

Thank you for such a though-provoking post!

January 8, 2008 5:36 PM

Aaron said:

Is there any place I can find some details about HOW Google tracks off-site clicks automatically?

I'm interested in the technical implementation--the method Google is using to track off-site clicks.

January 9, 2008 11:10 AM

Shawn Purtell, Google Analytics Support Tech Author Profile Page said:

@Adam:

You can indeed use both versions of the script on a single site while it's transitioning (although it's not a great idea). I would definitely avoid using both on a single page.

January 10, 2008 2:20 PM

Shawn Purtell, Google Analytics Support Tech Author Profile Page said:

@Dennis:

Any code that contains the urchinTracker() function will not be compatible with ga.js. I don't know if anyone has had a chance to update it yet. I'm sure it won't be long.

January 10, 2008 2:22 PM

Shawn Purtell, Google Analytics Support Tech Author Profile Page said:

@David:

Using ga.js with a third-party cart is just as complex as using urchin.js. Usually, you'll want to set pageTracker._setDomainName("none"); but this will not be the case for all situations, including if you have subdomains. The only way to make sure you are integrating Ecommerce correctly is to have someone look over your Google Analytics setup in a one-on-one environment, as many situations require specific, customized instructions.

January 10, 2008 2:26 PM

analytics india said:

The Code which conflicts with ga.js is not functional.. Additionally, Even ecommerce setup for Google analytics does not give accurate reporting, due to deletion of cookies by user etc.. which is about 40% high..

I have another question, about the Google Analytics code, it seems to be reporting null visitors, which is impossible, Has urchin.js stop working...

January 21, 2008 11:35 PM

Caitlin Minteer, Google Analytics Support Tech Author Profile Page said:

@ Analytics India

Urchin.js should still function correctly. It sounds like you may have a problem with your installation, and I recommend you get someone to take a look at it.

January 23, 2008 9:19 AM

Jim said:

When upgrading from the old GATC(urchin.js) to the new GATC(ga.js), is there any loss of reporting data collected under the old GATC implementation?

March 18, 2008 9:03 AM

Jeremy Aube, Google Analytics Support Tech Author Profile Page said:

@Jim: urchin.js and ga.js use the same cookies. When you're making the switch, as long as none of your pages go live without either tracking code, you should be fine.

March 18, 2008 10:55 AM

Eric Gourmet said:

Instead of urchinTracker(reportedUrl); cannot we just use the new GA code : PageTracker._trackPageView(reportedUrl) ; ?

April 10, 2009 3:33 AM

Michael Harrison, Analytics and Optimization Specialist Author Profile Page said:

@Eric: Yes, you certainly can.

May 30, 2009 8:32 AM

Post Your Comments

Feedback Form