473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to show onClick as a completed goal on Google Optimizer

Hello,

I have the following button on my site:
Expand|Select|Wrap|Line Numbers
  1. <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;"> 
  2. <b style="display: none;">Search</b> 
  3.  </button> 
  4.  
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.
Expand|Select|Wrap|Line Numbers
  1. onClick="goalTrack();"
  2.  
Expand|Select|Wrap|Line Numbers
  1. <script>
  2.  function goalTrack(){
  3.     var pageTracker=_gat.getTracker("UA-XXXXXX");
  4.     pageTracker._trackPageview("/kkkkkkkkk/goal");
  5. }
  6. </script>
  7.  
Thank you!
Oct 10 '10 #1
1 1205
acoder
16,027 Recognized Expert Moderator MVP
Does the following not work?
Expand|Select|Wrap|Line Numbers
  1. <button onclick="goalTrack(); return DoSearch(.."
Oct 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1599
by: SyrU | last post by:
I have the below code. I am trying to send information to a subroutine, I am getting an Object Required Error. <input type="button" name="pSearch" value="Search" onclick="DisplayRecords()"> ...
0
818
by: Timothy H. Schilbach | last post by:
Hi Everyone, I have an easy question I think. I have this datagrid and it has a button in it that deletes a field in my database. I dont want someone to accidentally click on it and BOOM! data...
13
2510
by: Logos | last post by:
There seems to be a serious difference between how FF an IE handle an anchor with an href containing a # and an onclick event. If the onclick event returns false, IE does not change...
9
1685
by: Todd | last post by:
Hello We have a page that loads a long list of things. Each row has an onclick where you can open a window for more information. When you do that the parent page refreshes to the top of the...
14
2150
by: Mtek | last post by:
Hi, We have a form defined with buttons like this: <a class="save_menu" href="javascript:document.Detail_Screen.action = 'savedata.php?screen=EDIT';document.Detail_Screen.submit();">Update</...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.