Antezeta LogoAntezeta Web Marketing

Reflections on search engine optimization, web analytics and web marketing

Antezeta Web Marketing header image 2

Comparison of Google Analytics / Urchin Tracking Scripts

by · 2 Comments ·

With the advent of asynchronous tracking code, many sites need to review the automatic tagging code they’re using to track items such as downloaded files and outgoing link clicks. Unfortunately Google doesn’t offer an official library for this purpose; each or administrator is on their own in selecting an extended tracking script.

Some of the important issues to consider

  1. How accurate is the tracking code? Will it work in all major browsers?
  2. Is the tracking code compatible with other JavaScript code in the site?
  3. Is it possible to configure downloads as either events or page views, based on file type? My general feeling is that document downloads should be configured as page views. Image or other non-document downloads should be configured as events. There are some limits using events in Google Analytics which need to be considered on a case by case basis.
  4. Is it possible to configure external link clicks as events or page views, independent of the download configuration? I would generally advise configuring external link clicks as events since site visitors will view the target page on someone else’s site. Do keep in mind current Google Analytics events limitations. Events cannot be used in defining goals nor profile filters.
  5. How much code will the tracking code add to a site? The code will need to be loaded at least for the first page a user views from your site. Slow loading times can be an issue for users stuck with slow cellular connections (Mobile Broadband is a misleading marketing invention – in many cases it is really not much faster than dialup) and may penalize a site in search engine results. Reliance on a Jquery library comes with significant overhead, somewhat mitigated if the jquery code from a central repository is already in a user’s browser cache or is already loaded by the site.
  6. How fast does the script execute on a page with many ? This will depend on several factors, including the number of on the page, the browser’s internal JavaScript engine and the available computer resources.
  7. Is the tracking code script encumbered by licensing restrictions?
  8. What version of the Urchin / Google Analytics tracking code is supported? Google has released three versions to date, as noted in the table below. Each tracking code script is usually developed for a specific version of the Google Analytics/Urchin tracking code. Urchin, through versions up until 6.501, is only compatible with urchin.js. Urchin 7 will most likely support ga.js.
VersionCodeIntroducedNote
1urchin.jsGoogle recommends that all sites migrate to ga.js except for Urchin users. Urchin users should install at least version 6.501 before migrating.
2ga.jsOctober 2007
3asynchronous ga.jsDecember 2009asynchronous tracking improves both page loading times and collection accuracy.

Table 1: Google Analytics Tracking Code versions

Only one of the scripts I’m aware of currently tracks downloads or external links triggered by a right click on a link. The same is true regarding the ability to selectively track downloads as events or page views depending on the type of download, i.e. by file extension. The idea is to be able to track document downloads (pdf, doc, odt, txt) as page views and non-document downloads as events.

SourceDocumentationUrchin.jsga.jsasynchronous ga.jsDownload TrackingDownload tracked asExternal link clicksExternal link clicks tracked asmailto clicksmailto clicks tracked asLeft, Right & Middle Click trackingNotesLicenseVersionRequires JquerySizeTotal SizeCode Location [you should NOT link directly to the file: 1) it isn't nice; 2) It is a potential security risk]
Advanced Web Metrics / Brian Cliftonhttp://www.advanced-web-metrics.com/blog/2008/06/08/updated-tracking-script-for-gajs/page viewpage viewpage viewBrian is known in the community for his excellent book on Google .not specifiednot specified2.2K2.2Khttp://www.advanced-web-metrics.com/scripts/addLinkerEvents.js
Advanced Web Metrics / Brian Cliftonhttp://www.advanced-web-metrics.com/blog/2007/09/10/tracking-links-to-direct-downloads-automatically/page viewpage viewpage viewnot specifiedJan 15th 20093.2K3.2Khttp://www.advanced-web-metrics.com/scripts/addLinkerEvents-ga.js
Antezeta / Sean Carloshttp://antezeta.com/news/google-analytics-tracking-scriptsevent or page view, based on file extensionevent or page viewUses onmouseup to track all mouse clicks. Will not currently track keyboard enter. Outgoing links can be tracked as events or page views independent of file downloads. File downloads can be tracked as either pages views or events, based on file extension. Program based on code originally written by Ronald Heft for his plugin.not specified; donations welcome1.0 beta2.1K72.8kCommented version:
http://antezeta.com/j/galinks-full.js
Minimized version:

http://antezeta.com/j/galinks-min.js

Francesco Terenzanihttp://www.terenzani.it/54/urchintrack-utility-tracciare-link-esterni-e-download-con-google-analyticspage viewpage viewRequires download extensions specified in each page – rather than in JavaScript include file.not specified0.2996b+ list of file extensionshttp://www.terenzani.it/wp-content/lab/javascript/ga-urchin.trackLinks/GA-urchin.trackLinks.js
Francesco Terenzanihttp://www.terenzani.it/113/tracciare-link-esterni-e-download-con-google-analyticspage viewpage viewRequires download extensions specified in each page – rather than in JavaScript include file.not specified1.021.3K+ list of file extensionshttp://www.terenzani.it/wp-content/lab/javascript/_ftTrack/_ftTrack.js
Goodwebpractices.com / David Towershttp://www.goodwebpractices.com/roi/track-downloads-in-google-analytics-automatically.htmlpage viewpage viewpage viewnot specifiednot specified2.6K2.6Khttp://www.goodwebpractices.com/downloads/gatag.js
Immeria / Stephane Hamelhttp://code.google.com/p/gaddons/events. Can be changed to pages but changes exits and mailto to pages as well.events or pagesevents or pagesBased on a script originally published by Justin Cutroni in “Google Analytics Short Cuts”. A modified version tracks center and right mouse buttons: http://www.diird.vic.gov.au/__data/assets/js_file/0009/119592/gaAddons-diird.jsMozilla Public LicenseV2.85.4K5.4Khttp://immeria.net/js/gaAddons.js
Immeria / Stephane Hamelhttp://immeria.net/gaAddons/event or page viewevent or page viewevent or page viewCan estimate page loading time; beware this is only a rough estimate. Can change bounce rate definition based on time on single page Supports integration with iPerceptions 4Q survey tool. Under active development, expect more features in the future.Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported Licensev2.0.61.3.2+5.6K76.6Khttp://gaddons.googlecode.com/files/gaAddons-2.0.min.js
Solutions for WordPress
Joost de Valkhttp://yoast.com/wordpress/google-analytics/event or page viewevent or page viewWordPress plugin. Earlier versions work with non-asynchronous ga.js code. Includes support for Custom Variables which allow segmentation on Logged in users, Author name, Single category, All categories, Tags, Publication year, Post type.GPL; donations welcome4.0.8http://downloads.wordpress.org/plugin/google-analytics-for-wordpress.4.0.8.zip
Ronald Hefthttp://ronaldheft.com/code/analyticator/event or page view (must be same for both downloads and exit clicks)event or page viewWordPress plugin.not specified; donations welcome6.1.1http://wordpress.org/extend/plugins/google-analyticator/

What’s your experience tracking outbound links and download with Google Analytics and Urchin?

Similar Posts:

Registration is now open for the next SEO Course (March 22 and 23) and Google Analytics Course (March 14 and 15) in Milan. Don’t miss the opportunity!

Originally published August 30th, 2010

  • Sean Carlos is a web marketing consultant & teacher, assisting companies with their Search (SEO + PPC = SEM), Social Media & Digital Media Measurement strategies. Sean first worked with text indexing in 1990 in a project for the Los Angeles County Museum of Art. Since then he worked for Hewlett-Packard Consulting and later as IT Manager of a real estate website before founding Antezeta in 2006. Sean is an official instructor of the Web Analytics Association and collaborates with the Bocconi University. Born in Providence, RI, USA, Sean received Honors in Physics from Bates College, Maine. He speaks English, Italian and German.


2 Comments so far ↓

Leave a Comment

Warning: Comments are very welcome insofar as they add something to the discussion. Spam and/or polemical comments without a rational justification of the author's position risk being mercilessly deleted at the sole discretion of the administrator. Yes, life is hard :-).