Track outbound clicks with Google Analytics and jQuery

Sometimes, you may want to know what outbound links a user is clicking on — say, if you’re linking to an affiliate’s site and want to be able to count the clicks you’re sending. Google Analytics offers this bit of code to accomplish this:
 
<a href="http://www.example.com"
onClick="javascript: pageTracker._trackPageview(’/outgoing/example.com’);">
 
and says:
Google Analytics provides an easy way to track clicks […]

Anchor-based URL navigation, Take 2

I noticed I was getting a lot of visits via Google for my post on anchor-based URL navigation with jQuery, so I decided to write a plugin that would accomplish the same thing.

Download the plugin
View a demo

Call this function on an element that contains “panels” which, in turn, contain anchors. The container element should […]

Anchor-based URL navigation with jQuery

Update: I’ve since written a anchor-based URL navigation plugin that attempts to capture what’s described below.

I’m working on an application that has several panels of content, each accessed by clicking on a link in the page’s main navigation. I wanted to give users the ability to get back to a panel after they’d left […]