Home » Internet » Affiliate Programs

A Simple 2 Step Method for Cloaking Your Affiliate Link

Aug 17, 2007
If you're an affiliate marketer, you know that there are some times when it might not be a good thing for your bare affiliate link to show. Whether it's a forum post, a blog comment or perhaps your affiliate link is simply too ungainly. Some people are uncomfortable clicking on a link that is long and cumbersome.

One of the biggest problems with bare affiliate links is when you try to send them via email. Have you ever received an email with a text link that was broken because it wrapped around to the next line? These line breaks usually happen when a link is full of variables. Examples of variables used frequently in affiliate links is the question mark, ampersand or equal sign.

With the great number of data driven web sites today a link that looks like the following is not at all uncommon:
"mydomain.com/index.php?option=aff_links&aff=12345T"
Links like this break easily when they wrap around to the next line, so it's often ineffective to use them.

Here is a simple, effective way to cloak your affiliate link that works every time. It requires that your hosting provider support PHP. If you aren't certain check with your provider, or just take a look at their features page and see if PHP is mentioned. Nearly all hosting providers support PHP now since it is open source software.

First, decide whether you want to keep your affiliate links in a separate directory or in the root of your hosting account. It's the difference between linking to yourdomain.com/yourlink.php and yourdomain.com/go/mylink.php. If you promote a large number of affiliate programs, I would suggest keeping your links in a separate directory.

I prefer the /go directory; but you can call it any name you like. Within that directory create a file for each affiliate link, and give it a .php extension. Be sure to give the file a name that you can easily identify. For example, if I had an affiliate program and you were promoting it, you might name the file ron.php.

Open the file, and place the following bit of code in it (make sure you insert the opening and closing php tags):

header("Location: mygreataffiliatelink.com");
exit;

That's all there is to it! Now, you can create a forum signature, an email signature or a blog comment using your affiliate link. Just point it at yourdomain.com/go/ron.php, or yourdomain.com/ron.php depending upon where you choose to store your links.

Another great thing about this solution is that you can place a tracking code in the file as well. For example, if you use Google Analytics, your file might look like the following (notice that I've removed the "exit;" function that you see in the example above):

header("Location: mygreataffiliatelink.com");
-insert html opening tags here. Including head open, head close, and body open tag
(paste the tracking code used by your tracking software/service in this section here)
-insert html closing tags here. Including body close and html close.

With this simple solution, you will be able to track how many people clicked on your affiliate link. Track this against the number of sales credited to your account to determine the conversion rate of the sales page. This will enable you to focus your efforts on the programs that are actually converting visitors to sales.
About the Author
Automate your link tracking with this amazing tool.
Ron Jones is the owner of www.internetprofit101.com
A free Internet Marketing resource that cuts through the hype and shows you how to succeed online.
Rating:
Please Rate:
(Average: Not rated)
Views: 131
Print Email Report Share
Article Categories