How do I track JavaScript events?
To track an event, use the urchinTracker JavaScript function to specify a name for the event. For example, calling:
javascript:urchinTracker('/homepage/link1');
will cause each occurrence of the the calling event to be logged as though it were a pageview for the URL /homepage/link1. The argument must begin with a forward slash. The event names may be organized into any directory style structure you wish.
For example, if you wish to organize events by page > type of event, you might organize a hierarchy along these lines:
* '/homepage/links/link1' * '/homepage/radiobuttons/button1' * '/contactform/rollovers/image1'
HTML Code Examples
The following illustrates how to log an onClick event:
<a href="javascript:void(0);" onClick="javascript:urchinTracker('/folder/file');">
Or, to log a rollover event:
<a href="javascript:void(0);" onMouseOver="javascript:urchinTracker ('/folder/file');">