Summary:
Amazon affiliate links cloaking is a simple technical solution that allows to simplify cloaking Amazon links compared to the generic affiliate link cloaking patter.
Name of the pattern:
Amazon Affiliate Link Cloaking
When to use the pattern:
When you have multiple Amazon affiliate program links on your site.
How to use the pattern:
Many Amazon affiliates use links and ads automatically generated by the Amazon Associates site. However, there were reports that occasionally they are generated incorrectly and don't result in the sales properly accounted for. The word on the street is that the correct Amazon affiliate link has a form http://www.amazon.com/dp/ASIN/?tag=YOURAFFILIATEID, for example, http://www.amazon.com/dp/0471469122/?tag=httpwwwgalien-20 I verified that type of links and they indeed work.
Of course, such simple structure of an affiliate link is widely open to so called stealing affiliate sales, when your affiliate ID is removed or replaced. Hence, link cloaking becomes even more important. However, considering that most Amazon affiliate sites promotes multiple products, making individual redirects for all of them is complicated.
Instead you will be able to use the links looking like:
by creating "asin" folder on your server and placing just two files into it. The files are .htaccess (if you run under Apache server as most people do) and index.php. You have to have module rewrite enabled and php available to use this.
.htaccess file:
>>>> CUT HERE >>>>
#
# Amazon affiliate links rewrite rules
# (C) http://www.InternetMarketingPatterns.com, 2009
#
RewriteEngine on
# Rewrite URLs of the form 'x' to the form 'index.php?asin=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /asin/index.php?asin=$1 [L]
<<<<<<<<<<<<<<<<
index.php:
>>>> CUT HERE >>>>
<?php
//
// Amazon affiliate links rewriter
// (C) http://www.InternetMarketingPatterns.com, 2009
//
$amazonId = "httpwwwgalien-20";
if (!empty($_GET['asin'])) {
$link = "http://www.amazon.com/dp/" . $_GET['asin'] . "/?tag=" . $amazonId;
}
else {
$link = "http://www.InternetMarketingPatterns.com";
}
header("Location: " . $link);
exit();
?>
<<<<<<<<<<<<<<<<
Attribution:
I've put it together while building some of my commercial sites.
Related patterns:
Affiliate Link Cloaking, Affiliate program, CPA
Related anti-patterns:
None
Details and comments:
The best thing about this pattern, is that you just put these two files in, and then a link to the new Amazon product becomes just a matter of slapping ASIN number to the end of http://yoursite/asin/
If you do Amazon affiliate sites, you certainly would appreciate that pattern.