Onclick events

Hi all:

I´m having this problem with multiple onclick on one link and maybe you can help me.

I have a link on my web page that i need to track with two Stats programs, and i need this link to be openned in a new tab.

So i need these 3 events (open i new tab and both trackers) to trigger each time a visitor clicks on that link.

The 3 onclick i need to use are these:

(Web-Stats tracking)

onclick=recordOutboundLink(this, ‘Installer’, ‘Install’); return false;
(Google analytics tracking)

(To open link in new tab)

So i tought my web page link would be like this :

<a href=“http://www.mediafire.com/?54iqcsl” onclick=“javascript:wtslog(‘al2243590’,‘3’,‘http’,‘Instalsr-installer’,‘event_track’); window.open(this.href); return false; recordOutboundLink(this, ‘Installs’, ‘Installer’); return false;” >Link</a>

But this doesn´t work. I read that i have to build a function that call these 3 onclicks but since im not familiar with programming languages even i have searched a lot i don´t find the appropiate syntax.

I´d need both, The function that calls the 3 onclick, and the syntax of the Link in my page itself. I tried to follow generic examples but i failed. Could you please show me how these syntaxes finally should look??

These would be great help to me since im stucked on this.

Thanks in advance :slight_smile:

This is the general method, but you will need to tidy up the tracker scripts. You will also need a page to open.
It works by handling the onclick event first, then returning true so that the link carries out its default action, which is to open the href page in the target window - a blank window in this case.



<style type=“text/css”>
#posnLink { position: absolute; top:100px; left:100px; width:200px; }
<script type=“text/JavaScript”>
function trackers(linkObj)
{ //Web-Stats tracking
// do something like
// javascript:wtslog(‘al2243590’,‘3’,‘http’,‘Installer’,‘event_track’;
alert(“process webstats”) // info only
// Google analytics tracking
// do something like
// recordOutboundLink(linkObj, ‘Installer’, ‘Install’);
alert(“process Google Analytic”) // info only
// return to allow link to finish opening page to new window (target)
return true;


<!-- you will also need a page to open before this will work –>
<div id=“posnLink”>
<a href=“pageToOpen.html” onclick=“return trackers(this)” target=“_blank”>Your
<!-- end of div posnLink –>