Spear Leaner

Flex the tech and roll. This is a documentation.


Which Google Analytics tracking code should I use?

There are two Google Analytics tracking codes offered.

  1. The older legacy tracking code aka (urchin.js)
  2. The New Tracking Code aka (ga.js)


Overview: The Legacy Tracking (urchin.js)

In my opinion, Google has not began to phase this out as many people still use it; many large money generating companies that still integrate it into their new and promotional pages. There is little harm, other than confusion, in keeping the two options available in the mean times. In order to phase the old one out there has to be a phase out plan, and that requires time and resources that are being invested in many other ventures and features in these days.

I looked for dirt on ga.js, and to little avail. Most things concerning the new ga.js script seemed to be positive. So lets look over the positive aspects the new ga.js script.

Overview: The New Tracking Code (ga.js)

This new code is designed to work proppery with SSL secured pages and non SSL secure pages alike. If you use the urchin.js code, then you would have to modify it's code by altering the http: to https:

This new code is said to open up new tracking features concerning eccomerce transaction. what these features are specifically I am not sure and couldn't find the answer.

Google reccomends the use of their ga.js script because they say it will make your website more compatible with future planned upgrades concerning Analytics. Significant time has passed since they first announced this statement, and many upgrades have been put in place, but there has been no warnings issued to Analytics users who use the older urchin.js code.

Other things Google State Directly about the New Tracking Code:
  1. ga.js is smaller source file, and in turn this will reduce download times.
  2. The ga.js script is object orriented, whereas the urchin.js file is function orriented. What this means for the common user, I cannot say.
  3. ga.js has automatic detection of https(as mentioned above).
  4. ga.js provides increased namespace saftey, which might mean it allows them possibility of more unique identification codes that relate Analytics to your website.
WARNING PROVIDED BY GOOGLE:
If you choose to use ga.js or urchin.js, whichever one you choose you must use on all the pages relating to a profile. They DO NOT inter-mix.

FINNAL SUGGESTIONS:

After my research I will go with ga.js, because I have no great reason not to, and small reasons to prefer it, such as the future upgrades and the quicker load/download times.

In the mean time, I still would like to be prepared just in case I made the wrong choice; so in a templates folder I am going to create two files :
  1. google_tracking_template_old.php
  2. google_tracking_template_new.php
and paste each code into it's respective php file. Thenafter for every page I will create I'll include the template with the new code in it and if ever i need to switch over then I'll run a mass search and replace (which can be done with the Search & Replace Master tool linked in this blog on the right) and changed the new to the old.

Here is the php code I use to include a file:
include_once('google_tracking_template_new.php');


------

If your company's marking department is involved in printing or direct mail marketing then check out my employer's websites. They are price leaders in their industry and trying to come up on the google battlefield. Below are the links, thanks!
Postcard Pros | Postcard Mailing
Custom Postcard Printing







0 replies

Post a Comment



Subscribe to: Post Comments (Atom)