- Set up Event Tracking in your Analytics Tracking code. This is a simple matter of adding the following line to the tracking code for your pages after the page tracking object is set up:
- Update your outbound links to call the new function without first following the link. For example, to log every click on a particular link to www.example.com, you would use the _trackEvent() method in the link’s tag:
XHTML1<a href="http://www.example.com" onclick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">Trackable Link</a>
The example above uses the category label Outbound Links. This is a useful way to categorize all outbound links in the Event Tracking reports. It sets the specific name of the website as the second parameter in the call. With this structure in place, you could then see Outbound Links as one of the event categories and drill down to see which particular outbound links are the most popular. Be sure to use return false for the onClick handler, because without that statement the browser will follow the link before the recordOutboundLink method has a chance to execute.
For more information on using event tracking, see the Event Tracking Guide on Google Code.