Amazon affiliate links cloaking technique - enjoy

by MSGeek
2 replies
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. ASIN is the Amazon Serial Index (ISBN-10 for the books), and YOURAFFILIATEID is, well, your affiliate ID. 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:

http://YourSite/asin/ASIN

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 >>>>
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
$amazonId = "httpwwwgalien-20"; // <--- put your Amazon ID here

if (!empty($_GET['asin'])) {
$link = "http://www.amazon.com/dp/" . $_GET['asin'] . "/?tag=" . $amazonId;
}
else {
$link = "http://YourSite"; // <-- put your site address here
}

header("Location: " . $link);
exit();
?>
<<<<<<<<<<<<<<<<
#affiliate #amazon #cloaking #enjoy #links #technique
  • Profile picture of the author p307ig
    Can you help me with cloaking the amazon affilate links on my site "www.bestcanondigitalcamera.net" (including WP amazon plugin)?

    I would be happy on any feedback.

    Best regards from Germany
    Manfred
    {{ DiscussionBoard.errors[1213319].message }}
    • Profile picture of the author MSGeek
      I don't use WP amazon plugin. What's the problem? Your site and links seems to be all right, everything should work. By the way, good site.

      About cloaking, the code snippets from Amazon contain links like
      All you have to do is deploy two files above and change these links to

      Of course, check that such links work after creating asin folder and putting .htaccess and index.php there. And considering how many of those links you have, it may be time consuming. But that's pretty much it.

      About Amazon plugin, if you can give URL from where you loaded it, I can briefly check and see what needs to be done there. But no promises, a lot of WP plugins are written in horrible style.
      {{ DiscussionBoard.errors[1216123].message }}

Trending Topics