Posts Tagged ‘link management’

A Better Way To Manage Affiliate Links

Wednesday, July 2nd, 2008

One of the more lucrative monetization methods for a blog is affiliate marketing (or referral marketing). Basically, you set up your blog with an affiliate link (or referral link) and send traffic to your advertiser. For each visitor that completes an action — i.e., subscribe to a service, buy a product, etc. — you’ll get paid a fixed amount or a percentage of the sale as compensation.

Three Problems With Affiliate Links

1. Non-Descriptive

Non-descriptive affiliate links are the ones that don’t tell the user information about the site it is leading to. This is a common problem with program like Commission Junction where a typical affiliate link looks something like this:

http://www.anrdoezrs.net/click-2899932-8291847

By the way, that’s the affiliate link for Lunarpages web hosting. However, with all the phishing scams, visitors are less inclined to click on a non-descriptive link because they are not sure where they will end up.

2. Complicated

Complicated affiliate links are the excessively long ones. For example, this is an affiliate link for a Garmin Nuvi GPS through Amazon.com:

http://www.amazon.com/gp/product/B000H49LXQ?ie=UTF8&tag=thelifsph0c-20
&linkCode=as2&camp=1789&creative=9325&creativeASIN=B000H49LXQ

That’s a pretty long affiliate link.

3. Hard To Update

As your blog ages, it could contain hundreds or even thousands of affiliate links. This presents a challenge if one of these links needs to be updated. For example, eBay recently left Commission Junction and started its own affiliate program, forcing publishers to update all eBay affiliate links.

Using PHP Redirect To Manage Affiliate Links

The three problems above can be addressed with a simple solution if you know a bit of PHP. We will use the Lunarpages link as an example.

First, you need to create a PHP file that redirects visitors to the affiliate URL when called — let’s call it lunarpages.php. This is how the file would look like:

<?php
header( ‘Location: http://www.anrdoezrs.net/click-2899932-8291847’ ) ;
?>

Note the Lunarpages affiliate link.

Second, upload the lunarpages.php file to your web server. I keep my PHP redirect files in a folder called go. For example:

http://www.blogthority.com/go/lunarpages.php

Now, I can simply link to this nicer looking link that tells my visitors that it goes to Lunarpages instead of the ugly “anrdoezrs.net” link. Try it: http://www.blogthority.com/go/lunarpages.php

A Better Way To Manage Amazon Affiliate Links

It would be extremely time consuming to manage Amazon affiliate links using the above method — i.e., one PHP file per product. Fortunately, we can use a PHP variable to solve the problem — this way, one PHP file can handle multiple products.

First, the PHP file. Let’s call it amazon.php. This is what it would look like.

<?php
$asin = htmlspecialchars($_GET[‘asin’]);
$link = “http://www.amazon.com/gp/product/” . $asin . “?tag=your-affiliate-ID”;
header(“Location:”.$link);
?>

Note, be sure to replace your-affiliate-ID with your ID. Again, upload the file to your web server. Now, when I need to link to an amazon product, I can do the following:

http://www.blogthority.com/go/amazon.php?asin=B000H49LXQ

This is the equivalent of the long affiliate link in #2 above. Try it: http://www.blogthority.com/go/amazon.php?asin=B000H49LXQ

If you ever need to update any of these links, all you have to do is update the PHP file — one change and you’re all set!