How to Be Crafty and Mask Affiliate Links

Fine since Matt started this whole thing on hiding links and how people do it in really silly ways like putting nonsense in the onMouseOver WindowStatus I thought why not have a little fun and throw out a nice tip on how to mask your affiliate links.

Hypothetically speaking let’s say you’ve got a thin affiliate site, and you’re of the opinion having all affiliate links out is a “bad quality” indicator, or maybe you want to redirect your links for tracking, or maybe you even buy into the whole “no follow” advertising BS. Here’s one way to do it:

http://example.com/linkout.php?url=amazon.com

You write your script on linkout.php to scan for the URL parameter and redirect accordingly via Javascript. Now lets look at this link

http://example.com/linkout.php?url=amazon.com&p=12345

Now you update your script that so when it detects the “p” parameter instead of redirecting to amazon.com as a straight link it grabs the affiliate link in your database for ID 12345 and redirects accordingly. Regular people will think it’s a straight link and not an affiliate link. Now let’s get even more crafty

http://example.com/linkout.php?url=amazon.com&p=a12345
http://example.com/linkout.php?url=amazon.com&p=b12345

Lets make our script even smarter if the “P” parameter starts with an “A” we go and get the affiliate link from the database, if it starts with a “B” it’s just a dummy value and we use the URL value anyway. With the goal of being a responsible programmer I’d say you should use the “url” parameter as the default value and overwrite accordingly, but I digress. Want to get even more crafty how about this

http://example.com/linkout.php?url=amazon.com&p=c12345

When there is an “A” or “B” in the “P” parameter we redirect via Javascript and be sure to include the Noindex, NoFollow meta tags. However but when there is a “C” in the “P” parameter we redirect via a 301 instead of javascript. You could even be a little more clever and only do the 301 if you know it’s a search engine bot.

Lastly as a responsible programmer I should also warn you about not leaving yourself open to abuse. You should check for a referrer, and strip it down to the base domain, if it’s not you take whatever action you deem appropriate. Sure the examples given here might be pretty easy to spot, but they were also highly examplified. You could totally wonk things up adding random numbers or unix time values in for the dummy values, which would really make things harder to reverse engineer. You could also put the actual landing page URL instead of the simplified version I did here just to make things look that little bit more legit to pesky humans. There are few other things you can do, but I have to keep a few things dark and mysterious.

GraywolfSEO.com runs on the Genesis Framework

Genesis Framework

Genesis lets you to quickly and easily build amazing websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.
It's that simple - start using Genesis now!


Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.


tla starter kit

Advertisers:

  1. Text Link Ads - New customers can get $100 in free text links.
  2. BOTW.org - Get a premier listing in the internet's oldest directory.
  3. Need an SEO Audit for your website, look at my SEO Consulting Services
  4. TigerTech - Great Web Hosting service at a great price.
More in Grayhat SEO
How To Shoot Yourself in The Foot With Bad Plan and a Bad CMS Implementation

One of the biggest mistakes really large publishers make today is doing SEO like it's 1999. They throw up hundreds,...

Dave Pasternack of Did-it.com Spamming MyBloglog

I got a tip that our friend Dave Pasternack has taken to spamming MyBloglog now. Pretty nice, one community is...

Google MFA and No Way Out!

I know Werty showed something similar to this at pubcon, but this is as bad as I've ever seen it....

Close