Follow @XavierMedia at Twitter.com

Xavier Media® Tools and tips for webmasters and bloggers

  Subscribe via email

  Subscribe via RSS
  What is RSS?

  Follow @XavierMedia

  Join our community

XavierMedia.com

Webmaster Tools

Keywords

Recent Posts

Blogs

RSS iPhone and iPad stuff – Most Useful Things

Photo by Andreas Bylund

How to hide your affiliate links – part 2

August 7th, 2009 by Andreas from Xavier Media®

In part one of this series I showed you how to mask your Clickbank affiliate hoplinks using Clickbanks built in link masking. This is however not an optimal solution since the links still say clickbank.net in the URL. Therefore we're going to have a look at  Javascripts to mask links instead.If you've never worked with Javascript before this may seem extremely technical, but we'll start with an easy example.

The simple Javascript redirection

This code works great if you only have one link per page you need to protect. Add this code somewhere between the <HEAD></HEAD> tags in your code:

<SCRIPT LANGUAGE="JavaScript">
<!–

function Redirect(){
window.location = "http://www.sampleaddress.com";
}
// –>
</SCRIPT>

Just fill in the URL you want your visitor redirected to instead of http://www.sampleaddress.com and you're almost ready to test the script. Now you need to create a link somewhere in your page. The link need to look like this:

<A HREF="javascript:Redirect();">Test link</A>

As you can see we're using some code instead of filling in the URL to the page in the code above. This is because when this link is clicked on by the visitor the script will be executed redirecting the visitor to http://www.sampleaddress.com or whatever link you filled in instead.

The advantage with this code is that the user can't see where the link is going by just holding the mouse pointer over the link. In the browsers status bar they will just see this:

Javascript Redirection: Browser status bar

In next part of this series I will show you how to setup a Javascript for multiple links and also how to move the script to a separate file to hide the links even more.

You may also be interested in...
How to hide your affiliate links – part 3
How to hide your affiliate links – part 1
How to hide your affiliate links – part 5

Subscribe to new posts from this blog

Leave a Reply

RSS 24/7 Webmaster

RSS Adv.erti.se

RSS Public Information

RSS XavierMedia.org

© Copyright 1996-2010 Xavier Media®. All rights reservered.
Contact us | Support/help | Privacy Policy | Company Info
The World According to Xavier | Domain Names