Page 1 of 1

onClick question

Posted: Sun Oct 10, 2010 5:18 pm
by avios
Hello,
I have the following button on my site:

Code: Select all

<button onclick="return DoSearch('EN','_parent','111', document.getElementById('ySearch').value, 'www.test.com', '112', 'SE')" type="button" style="cursor: pointer; background: url(images/button.jpg);border: none;"> 
<b style="display: none;">Search</b> 
 </button> 

 
I would like to add Google Website optimizer and to determine that every time a visitor clicks the button, it will be considered as a goal completion.
In order to do it, I need to somehow add the below code, but I'm not sure how exactly to do it and would appreciate your help.

onClick="goalTrack();"

<script>
 function goalTrack(){
	var pageTracker=_gat.getTracker("UA-XXXXXX");
	pageTracker._trackPageview("/kkkkkkkkk/goal");
}
</script>

Thank you!

Re: onClick question

Posted: Sun Oct 10, 2010 5:32 pm
by s.dot
onclick="goaltrack(); return dosearch();"