How To Make and Iframe Affiliate Link Open in a New Window

If you are an affiliate of a product that doesn’t pay much but you want to offer it to your audience because it is beneficial to them, the last thing you want to do is have that affiliate link open in the same tab/window whereby making your audience leave your site. It’s not worth the loss if time-on-site metrics for such low payouts. But if you are using a banner that is in an iFrame, it’s not just a matter of adding target=”_blank” to the hyperlink’s code. It’s a little different but equally as easy.

As an example, in my case, I wanted to promote NameSilo because they have very low prices on domain registrations and they offer many free services (like WHOIS Privacy) that most other domain registrars charge for. Yet they have been in the business for a long time and are reliable. But they don’t pay much so I didn’t want their link to open in the same window thereby taking my visitors away from my site.

Problem is, the banner I wanted to use was an iFrame (which is great because it doesn’t get blocked by the AdBlock Plus ad blocker) but it did not open in a new window as the target on the merchant’s side was set to “_top” instead of “_blank”. So I did many searches online as to how to make the link open in a new window and all of them did not work. So I emailed the merchant and they showed me how.

Here is the code of the original banner I wanted to display on my site…

<iframe src="https://www.namesilo.com/images/affiliate_assets/62.php?aid=f1deb21du&bid=62" width="468" height="60" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>

Which is this banner..


(if you don’t see the banner, your ad blocker is hiding it.)

Note: Since I made this post, NameSilo has changed the coding on their end at my request so that the banner link opens in a new window without having to modify the iframe code. But this tutorial isn’t exclusive to NameSilo banners so the information is still useful and valid.

Now if you search for a domain using the banner and the submit button, you are taken to Name Silo’s search results page but you are taken away from here. But if you want to make the submit button open the search results page in a new window, you just have to add “&new_tab=1” to the end of the link in the iframe banner’s code. So the new code will look like this…

<iframe src="https://www.namesilo.com/images/affiliate_assets/62.php?aid=f1deb21du&bid=62&new_tab=1" width="468" height="60" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>

Which results in the following banner…


(if you don’t see the banner, your ad blocker is hiding it.)

So now, if you do a domain search using the banner, you will be taken to the same results page, except it will open in a new window or tab and this page will remain in it’s own tab.

Hope this helps someone else as it did for me.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.