While searching for information on 'how to combine two onclick events', I have come across several solutions online. However, none of them seem to work in my specific case. One tutorial from Google Website Optimizer explains how to track an event like a click. The first step is to add the following code to my Analytics:
function doGoal(that) {
try {
Next, I am required to include the following in my event:
onclick="doGoal(this);return false;"
The challenge arises when my event is already a button containing its own onclick event:
<input type="image" src="image.png" onclick="productAddToCartForm.submit(this);return false;">
Attempting to merge the two has not yielded the desired results - either nothing gets recorded by Google or I get redirected to an '/undefined/' page. How can I effectively combine these two onclick events?