February 22nd, 2013 Add Your Comments Bookmark and Share

Have you ever wanted to open up 2 windows from 1 click? Me too! Back in 2008 I signed up to a number of affiliate programs for one website where the landing page I wanted wasn’t a viable target for a referral URL. In other words I wanted to direct the visitor to a certain page whilst still getting credit if they did sign up so this required opening 2 windows from the 1 click. Sounds simple and it was but now in 2013 I’ve discovered I made a massive mistake that has cost me god only knows how many thousands of pounds.

To open 2 windows it is a simple case of using your normal anchor tag but also including a onClick event handler to launch the new window using Javascript, here’s a quick example:-

<a href="http://www.mysite.com/referralurl" target="_blank" onclick="window.open('http://www.mysite.com/targetredirect')">Click Here</a>

Like I said, very simple.

I tested this on my usual browser Firefox and Chrome and it all worked ok. I had a gut feeling that it may cause a problem with Internet Explorer and its popup blocking behaviour so that is why I included my referral link as the anchor tag, assuming that if there was a problem it would be with the Javascript. I may not be able to get the visitor to the exact page I want but it’s making the best of a bad situation.

However my assumption was very wrong. When this code fails on Internet Explorer and prompts for permission to allow pop-ups it’s not the javascript page that gets blocked, it’s the original anchor tag URL! This is a huge mistake on my behalf. Over the 4 years the referrals from those links have generated in excess of £80,000 (about $120,000 US dollars) for me. But I’ve only been getting credit for less than half the traffic I’ve been sending because anybody using Internet Explorer has had the referral link blocked. Since putting this right my number of new sign-ups has more than doubled. I really have screwed up big time here.

What makes it even worse is that the fix is so simple. If you want to stop Internet Explorer throwing a pop-up exception when opening 2 windows all you have to do is make sure you don’t set a target for the original anchor tag. So instead of having

<a href="http://www.somesite.com" target="_blank" onClick="..... you just have <a href="http://www.somesite.com" onClick="....

As simple a fix to as costly a mistake as I would ever like to make.