Welcome to WebmasterWorld Guest from 54.161.228.30

Forum Moderators: buckworks & eWhisper & skibum

Message Too Old, No Replies

Tracking Event as Conversion using onclick function Tracking

Event tracking using onclick feature

   
11:45 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi everyone,

I am trying to get analytics to track a click on a button as an event so I can create goals and import these into AdWords.

The current code for the button is;

<a class="button" href="javascript:void(0)" onclick="javascript:window.open(getDetailUrl(),'popup','resizable=1,scrollbars=1,status=no,left=50,top=50,width=550,height=350');">Show</a>

I have the following bit of code which I have to something with, but I'm just not sure what it is....

<a href="#" onClick="_gaq.push(['_trackEvent', 'PopupDetails', 'Click']);">View Contact</a>

Does anyone know how I am meant to get this working correctly or do you need any more info from me to be able to help?

Any help is appreciated. I'm not good with coding as you might know :-)
2:36 am on Jan 20, 2012 (gmt 0)

5+ Year Member



Hi briggidere,

I had a similar question as well. Saved this link. You can give it a try. Hope it helps
[answers.yahoo.com...]
8:00 pm on Feb 20, 2012 (gmt 0)

10+ Year Member



Try this:

<a class="button" href="javascript:void(0)" onclick="javascript:window.open(getDetailUrl(),'popup','resizable=1,scrollbars=1,status=no,left=50,top=50,width=550,height=350'); _gaq.push(['_trackEvent', 'PopupDetails', 'Click']);">Show</a>