Affiliate link protection

So you’ve built your website, optimised it for search engines, sorted out your affiliate marketing and put your site live on the web. Someone comes along, sees your fantastic new site and decides that your well chosen affiliates are worth having a look at.  They click the link, make a purchase and you get that well earned 10%.

Well not always…

There are people who just strip the affiliate ID from the link so that you earn 0% but worse still, there’s software out there that can maliciously strip your affiliate ID and replace it with someone else’s so that when your well intentioned customer makes a purchase, your hard earned cash goes to someone else.  Sometimes the customer’s computer may unknowingly have the software on it, but other times the affiliate site itself might have been hacked.

 


So what can I do about it?

Protect your affiliate link. There are various ways to do this and I will discuss 3 here, but my personal favourite is using a PHP redirect.

In the three examples below, I’ll use the fictitious site and affiliate link of:

http://www.imaginarysalescompany.com?ref=joe99

www.imaginarysalescompany.com is the site, and Joe99 is the affiliate ID.  In all cases replace this link with your own affiliate link.

 


Option 1) PHP redirect.

Copy the following code into notepad or similar, remembering to change the link with your own affiliate link:

  • <?php header( “HTTP/1.1 301 Moved Permanently” ); header(“Location:http://www.imaginarysalescompany.com?ref=joe99“); ?>

Save the file as php-redirect.php to your computer (the filename is not important but the extension .php is)

Upload the file to your own website

Then instead of using your affiliate link like this:

  • <a href=”http://www.imaginarysalescompany.com?ref=joe99” >my affiliate link text</a>

Link to the php redirect file instead like this:

  • <a href=”php-redirect.php” >my affiliate link text</a>

Your website must have PHP enabled for this to work, most websites do but if you are unsure, contact your web host.

 


Option 2)  Java script redirect.

Copy the following code into notepad or similar, remembering to change the link with your own affiliate link:

  • <HEAD>
    <SCRIPT language=”JavaScript”>
    <!–
    window.location=”http://www.imaginarysalescompany.com?ref=joe99“;
    //–>
    </SCRIPT>
    </HEAD>

Save the file as java-redirect.html to your computer (the file name is not important but the extension .html is)

Upload the file to your own website

Then instead of using your affiliate link like this:

  • <a href=”http://www.imaginarysalescompany.com?ref=joe99” >my affiliate link text</a>

Link to the java script redirect file instead like this:

  • <a href=”java-redirect.html” >my affiliate link text</a>

 


Option 3) HTML ‘meta-refresh’ redirect.

Copy the following code into notepad or similar, remembering to change the link with your own affiliate link:

  • <html><head>
    <meta name=”robots” content=”noindex,nofollow”>
    <meta http-equiv=”refresh” content=”0; url=http://www.imaginarysalescompany.com?ref=joe99“>
    </head>
    </html>

Save the file as html-redirect.html to your computer (the file name is not important but the extension .html is)

Upload the file to your own website

Then instead of using your affiliate link like this:

  • <a href=”http://www.imaginarysalescompany.com?ref=joe99” >my affiliate link text</a>

Link to the html redirect file instead like this:

  • <a href=”html-redirect.html” >my affiliate link text</a>

 


Are there other redirects available?

Yes. There are more variations of the above redirects, all with subtle differences, and there are also .htaccess redirects but these .htaccess redirects only work on Apache servers and if you mess things up you could block access to your website so always do a complete back up before trying to change .htaccess files.

You should never need to use anything more complicated than options 1 or 2 above for a simple redirect although option 1 requires your web host to support PHP, which most do.

 


Related information and links.

unsure how to link to a URL? visit w3schools.com for a full explanation.

I hope you found this information useful and I welcome your comments.

If you have any specific questions related to website development, please email me or post a comment.

Worcestershire Web Designer

 

 

 


Bookmark and Share

8 Responses to “Affiliate link protection”

  1. Ram Gunjal says:

    Hi,
    Thanks for the quick tips but some affiliate network will ban you if you redirect your affiliate link with meta refresh. I am simply using short url to protect my affiliate link.

  2. Paul says:

    Do you have to create a separate file for each affiliate link?

    Regards

    Paul

    • Hi Paul,
      Yes, you will need to create a separate new file for each new affiliate link.

      What I normally do is duplicate the original redirect file and then change the filename and link within the file to match the new affiliate link.

      Using the php redirect as an example, I just add in who the link is to so it’s easier to recognise.

      php-redirect-uk2.php;
      php-redirect-iconshock.php;
      php-redirect-amazon.php.

      Regards

      Worcestershire Web Designer

  3. [...] For WordPress: Affiliate Link Cloak Plugin in Uncategorized by McNicholl HoldingsHow to create a redirect pageAffiliate link protection | blog.worcestershirewebdesign.co.uk [...]

  4. markez linda says:

    I really liked your blog!

  5. You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.

  6. GarykPatton says:

    Hi! I like your srticle and I would like very much to read some more information on this issue. Will you post some more?

  7. Extremely useful information. I’ve heard of affiliate link stripping before but didn’t think there was anything I could do about it. Thanks for the tip.
    JohnW

Leave a Reply

Dansette