You can track onclicks and any other JavaScript events that you wish to monitor as actions.
To set up tracking for an onclick event, go to Settings - Action tracking - Track sales, revenue, form submissions, downloads and custom actions and enter your custom action in one of the fields available, e.g., Email Link.

Customize the tracking code on the targeted page - Create a wrapper function
Example
<script language="Javascript">
function captureOnclick(actionnumber,)
{
var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction(actionnumber);
YWATracker.submit_action();
}
</script>
Call the onclick
Call the onclick to attach it to the wrapper function and provide values:
<a href="ref.htm" onClick="captureClickout('02')";> <img src="../images/emails/info.gif">
In our example, the action ID for the Email Link action is 02.
Use another wrapper function, as needed
If you need to track additional information about the onclick action (e.g., two custom fields to store extra information associated with the action), you can do so by using another wrapper function.
Example
<script language="Javascript">
function capture_action_and_cfs( action_num , cf_a , cf_b)
{
YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction(action_num);
YWATracker.setCF('17', cf_a );
YWATracker.setCF('18', cf_b );
YWATracker.submit_action();
}
Call the onclick
Next, you need to call the onclick, which attaches the onclick to the wrapper function and provides values:
<a href="ref.htm" onClick="capture_action_and_cf( '02','blue' , 'strawberry')"> <img src="IMG_1.jpg">