Not to be confused with referrer cloaking, cloaking affiliate links is typically done to present a nice looking URL to the user. The idea is, the savvier visitor might see a weird URL in the browser status bar and be less likely to click—so it’s best to cloak the link. If you’re using this technique for a landing page that you’re driving paid traffic to, then one of the usual link cloaking methods is fine.
Cloaking affiliate links on a niche site or datafeed site that’s relying on organic traffic is a different ballgame. A big part of doing this successfully is avoiding duplicate content issues and being pegged as an affiliate site with no added value. Unless you’re retarded you’re already mixing up and/or adding some value to the stock content provided by the merchant, but one problem remains…
When a search engine spider follows your out links, it will see them route through an affiliate network then to the merchant’s site. It’s easy to see that this can be used to identify your site as an affiliate site and therefore bury it in the SERPS. So what can you do?
My epiphany happened when I was reading Rae Hoffman’s post about datafeed sites. Among the tips she offers is one that made a light bulb turn on in my head:
Run your links through a blocked folder. Genius!
To make this work, first create a directory in your site’s html root directory (usually “public_html”). You can name this directory anything. In this example, I’m going to name my directory “store”.
The Redirect Script
In this new directory “store”, create an index.php file with the following code:
1 2 3 4 5 6 7 8
<?php // simple redirection script // pass a get variable 'item=' with value that's urlencoded and base64 encoded $item = $_GET['item']; $url = urldecode($item); $url = base64_decode($url); header("Location: $url"); ?>
This code is designed to accept a URL passed using the “item” variable and then redirect the visitor.
The Encoder Script
This next bit of code is how you encode your links.
1 2 3 4 5 6 7 8 9 10 11
<?php // Simple base64 encoder // Enter your affiliate link here // e.g. $url = "http://www.shareasale.com/m-pr.cfm?merchantID=12345&userID=77777&productID=123456789"; $url = "http://ctrtard.com/"; $url = base64_encode($url); $url = urlencode($url); echo $url; ?>
We encode the URL for the sole purposes of making it not look like an obvious affiliate link. For niche mini sites, you can just use this code to encode your links one at a time before placing them in your blog. For larger sites that have many affiliate links, you’ll want to incorporate this into your site building scripts to encode all the links before generating the html.
The final thing you will want to do is setup a robots.txt file and place it in your site’s html root directory (public_html) that contains the following:
User-agent: * Disallow: /store/
In the above example, the URL I chose to encode is “http://ctrtard.com/” . The encoded version of this URL is this:
So to use this, you’re link would be:
When the visitor clicks on the link, they will get redirected through your affiliate URL to the merchant’s site. The search spiders, on the other hand, won’t ever follow this link. That’s because they’re obeying the rule you set in your robots.txt file that tells them they are not allowed to spider anything in the “/store” directory. This prevents the search engines from indexing many links to a merchant and realizing you’re simply an affiliate for XYZ merchant.
Sweet! You’ve just avoided leaving yet another fingerprint that says you’re a an affiliate site and gained a little advantage over the competition.
There is no reason you can’t add on dummy variables to your links. The redirect script above only cares about the value of “item”. You can easily add other dummy variables to make your links look different. For example:
In both of these above cases, the “show” and “zoomlevel” will be ignored by the redirect script, but you still get the benefit of having it look like the on-page links are different.