Hide those links and logging your affiliate clicks – Part 1

November 28, 2009

Part 1 – Hiding your affiliate link

One thing I learned early on was the need to cloak links. Sure, you can use services like tinyurl.com or others but why? If your webhost has PHP like my HostGator does then you can do it on your own with some simple code. In addition, when you decode the link you can log the click to a plain text file, insert it into a database or anything else you want to do with it. For me, I simply send myself an email each night with all of the clicks for the previous day. To do this I enabled a cron job with a simple shell script.

So, for the code to hide the affiliate link:

<table><tr><td><a href='go.php?id=aHR0cDovL3d3dy5qZG9xb2N5LmNvbS9jbGljay0yODI0OTI0LTEwMzk1ODM0'>Print Coupons Online Now!</a><br /></td></tr></table>

Copy and paste the code into a plain text editor such as Notepad and save as cloak.php. Upload it to your server and test the page out. Hover over the link and you will see that http://www.jdoqocy.com/click-2824924-10395834 is completely masked. Personally, I develop locally using LAMP for windows, called XAMPP. You can find it here Apache Friends. That way all you have to do is save the file in a folder under htdocs and call http://localhost/foldername/cloak.php. I highly recommend a development environment for your websites.

So why is link cloaking so important for affiliates? Well, take the eBay partner network (EPN) for example. All of the links are clearly defined with campid= in the unencoded links. Say a competitor starts throwing links on sites that are no longer approved, wordpress.com, squidoo.com etc with your campaign id’s in it. I for one have been reading and following the discussion forums for the EPN network and I can tell you, the response isn’t that good from eBay in situations such as this. So, better to be safe than sorry. Cloak your links. Follow these tutorials and be sure you are protected. Don’t be left stranded trying to contact eBay once you get the “you are banned” letter.

This is the first in this series. Next we will learn what to do with this link so we can decode it and send it off to the affiliate url. After that, we’ll learn how to get this thing in cron so you can get an email each day about your clicks.

« Previous -- | -- Next »

Leave a Reply