For both security and search engine optimization, is the following method a legal way to cloak affiliate links? I created a directory restricted by robots.txt which holds a bunch of php files that redirect visitors to the affiliate link. For example: <html> <head> <title>Affiliate Title</title> <meta name="robots" content="noindex,nofollow"> <script>window.location="http://www.affiliatecode.com";</script> <meta http-equiv="refresh" content="1; url=http://www.affiliatecode.com"> </head> <body> <p align="center">You are being taken to the correct page. <br>If the page does load after 5 seconds, <a href="http://www.affiliatecode.com">click here</a>.</p> </body> </html> Code (markup): Now on the affiliate page I just link rel="nofollow" to the php file and the user goes to the intended target without revealing the affiliate code. My hope is to make the links much simpler, improve click through rates, and also remove any negative impact search engines hold toward sites using affiliate code. Would Google penalize for operating this way? How about the affiliate programs themselves? Would Commission Junction not like how this has been implemented? Is there a better approach? Thanks
Good question, I am going to try to dig up some dirt on this. I am not an affiliate nor have I worked with any affiliates but now you have me very interested. I will come back with what I find if no one else answers the question.
It should work as long as JavaScript is enabled and not stripped by a firewall. Chris Beasley does the same thing with WordPress and vBulletin - he calls it a "Two Step External Links" redirect. http://www.websitepublisher.net/blog/2009/07/22/introducing-two-step-external-links/
I would say most affiliate links are hidden, I will recommend that you use 301 redirect instead of meta refresh. With meta refresh the 'referral' info is lost unless you are using Safari. (try it out).
I decided to go with a php redirect instead <?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.affiliatelink.com"); exit(); ?> Code (markup): I sure hope this is allowed by most affiliate programs and search engines.
Why don't you just use 301 redirect via .htaccess and mark that link as "nofollow"? Put this in your .htaccess redirect 301 http://www.domain.com/affiliate-link http://www.cj.com/tracking-id.html Code (markup): When use link just use this code <a href="http://www.domain.com/affiliate-link" rel="nofollow"> Code (markup): You can name whatever on the affiliate link. Hope this help.