Notification

Urchin WebAnalytics Software is discontinued and is no longer supported. All Urchin documentation applies only to the Urchin product as it was at the time of discontinuation, and does not apply to any Google Analytics products or services.

How do I track JavaScript events?

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');">
Search
Clear search
Close search
Main menu
8385734758158540133
true
Search Help Center
true
true
true
false
false