Why You Should Cloak Your Affiliate Links
Cloaking your affiliate links is the process where you show a “friendly” URL that automatically redirects a user to your affiliate URL. The basic purpose is to hide the ugly affiliate Hop link that will show up in the browser status window when someone hovers over your link.
For example an affiliate link to a certain product on your site could look like this:
http://www.yoursite.com/go/product.php
instead of
http://bob123.prodcutname.hop.clickbank.net/?tid=xyz
People are always wondering - is it really worth it just to hide an affiliate link since the average user won’t even realize it’s there? Well, there is another advantage to having redirected URLS rather than just for aesthetic purposes.
Imagine that you have your affiliate link on many pages on the Internet, such as an article, or your squidoo page etc. If that URL ever needs changing, you will have to find all the locations you used and make the change which can be quite time consuming. Well, if you do a proper cloaking technique, you can manage all your links from different pages into one file location on your own server.
The technique I use is pretty simple using a bit of PHP coding (although it can be any server side programming language). Create a folder on your server where you want to keep all your affiliate link files and name it something simple such as “go” or “links.” Now create a new PHP file for each of the products you want to link to and put this line of code in.
Lets called it product1.php and put this code in:
<?php header("Location: http://www.afiliatelinkhere.com"); ?>
That’s it. Now you can reference that file from any a tag on any site where you are promoting the product.
Example:
Check out this <a href="http://www.yourserver.com/go/product1.php"> amazing product!</a>
If the link ever needs updating or changing, you only have to change that one file located on your server.
Advanced Cloaking with Tracking
Now, if you’re read for the next step, you’ll want to be able to pass a tracking variable so you can see where a sale was made from. Clickbank products have a field you can pass called the TID and CJ it’s called SID. Regardless of what it’s called, it’s important to pass this tracking variable because it will show up when a sale is made which referring link it came from.
So all you need to make is a tiny adjustment to the code. Here it is:
<?php $tid = $_GET['tid']; $url = 'http://www.afiliatelinkhere.com/?tid=' . $tid; header("Location: " . $url); ?>
and when you reference the link, add on some code after the ?tid= to help you track where that link came from:
Check out this <a href="http://www.yourserver.com/go/product1.php?tid=abc"> amazing product!</a>
In this case, I used “abc” as an example. You’ll want to use some tracking code sequence that makes sense to you for when you retrive it later. If the link is coming from your homepage top banner, you could call it hptp1, or something that makes sense later. This way, you’ll know that the link that created the sale was from your homepage and top banner.
So there you have it. Happy cloaking ![]()
Related Articles:
Filed under: Affiliate Marketing on August 20th, 2008
Leave a Reply