Update 2011-10-10! Check out gaAddons free script example!
Important! Please see "gaAddons open source project: enhancing Google Analytics" instead.In my opinion, tracking outbound links and downloads should be part of any good web analytics implementation.

Introducing gaAddons.js
The goal of this script is to automate a couple of common tagging requirements: outbound links, download links and email links tracking. It makes the job very easy and reduce risks of errors. Basically, just add a reference to gaAddons.js as explained bellow and voilĂ !Outbound links:
- Event: "outbound"
- Action: "click"
- Label: target URL
- Event: "mailto"
- Action: "click"
- Label: email
- Event: "download"
- Action: "click"
- Label: URL of downloadable document. The default looks for the following regular expression:
/\.(docx*|xlsx*|pptx*|exe|zip|pdf|xpi)$
It basically says: "Look for any links ending with a dot, followed by any of the popular file extension"
Those can easily be changed in the gaAddons.js script.
Get going with gaAddons.js
To get going, do the following:- Get the gaAddons.js script and save it somewhere on your own server
- Add this line near the closing BODY tag of all your pages, just after the standard Google Analytics tag:
<script src="/js/gaAddons.js" type="text/javascript"></script>
Integrating the code
Your code should look like this:<script src='http://www.google-analytics.com/ga.js' type='text/javascript'></script> <script type='text/javascript'> var pageTracker = _gat._getTracker("UA-999999-1"); pageTracker._trackPageview(); </script> <script src='gaAddons.js' type='text/javascript'></script>
Your tracker variable should be named "pageTracker", otherwise you will need to modify the gaA_pageTracker variable in gaAddons.js code.
Looking at the stats
Once your change is live, give Google Analytics some time to gather data and look under Content/Event Tracking for outbound, mailto and downloads stats (if using events, the default), or under Content/Content Drilldown for /outbound, /mailto or /download statistics if using the page view method.---
Credit where credit is due! A while back, Justin Cutroni at EpikOne published "Google Analytics Short Cuts". This script is an optimized/improved version of his script. Also inspired from the work of Brian Clifton, author of Advanced Web Metrics with Google Analytics