A while back I wrote a post about tracking outbound clicks with Google Analytics; way back then (about 6 months ago), the only event that Google Analytics could track was a pageview. Now that they've introduced the _trackEvent method of the pageTracker object, events that aren't pageviews don't need to count as pageviews anymore; instead, they can be counted as "events," and they can be categorized and labeled.

Here's an updated example of how to track outbound clicks using Google Analytics and jQuery. You'll of course need to be including the "new" analytics code (ga.js, not urchin.js) for this to work, as well as the jQuery library.

// see if the link is external
if ( (href.match(/^http/)) && (! href.match(document.domain)) ) {

// if so, register an event
var category = 'outgoing'; // set this to whatever you want
var event = 'click'; // set this to whatever you want
var label = href; // set this to whatever you want
pageTracker._trackEvent(category, event, href);

}
});
{% endcodeblock %}

You can use the same method to unobtrusively add tracking code to file downloads: