Skip to content
PHP Affiliate Jump Script

PHP Affiliate Jump Script

PHP Scripts > PHP Affiliate Jump Script

by Steve Dawson Database Developer (written in PHP) download here)

We all know that the big Affiliate Networks including Commission Junction, Linkshare and Tradedoubler are having problems with their links being blocked by third party programs such as Norton Antivirus. This is causing major problems in the Affiliate Marketing World as computers which run these program can not access click through links or banners, therefore not being able to produce a sale for Merchants who are promoted through these networks. By using a 'Jump Script, we can bypass this issue.

This PHP Jump script is ideal for the smaller site, but if you are designing a large site which utilises a datafeed from the Merchant, then we will cover this next time.


The scenario is that we have a website which we want to use to promote products and services from the major Affiliate Networks such as, Commission Junction (CJ), Tradedoubler, Linkshare, Affiliate Window, Affiliate Future, UK Affiliates and any in-house affiliate program. This guide can be used for all of these network affiliate links to hide them.

Getting Started

For this example we are going to use 2 of the UK's biggest Affiliate Networks, TradeDoubler and Affiliate Window and of course, their Mobile Phone Merchants and subsequent affiliate links.

Grabbing one of the Merchants Links, Just Phones on Affiliate Window we get the following: - Clicking this link will first take you Affiliate Window to log the click and then to the Merchants website, which in our case is Just Phones.

Now this link does not look too pretty when the visitor does a 'mouse over' on the link. We want something shorter and snazzier and not forgetting the fact to hide the URL so the visitor does not know it's an affiliate link.

We can turn this long URL into: "jump.php?m=Just Phones" so the actual HTML link code will look like
<a href="jump.php?m=Just Phones">Just Phones</a> and the user will be directed to the correct URL by the PHP Jump script.

The PHP Affiliate Jump Script

This very basic affiliate jump script is made up of the following:

PHP Affiliate Jump Script Source

Breaking the script down we get:

  • $m - This is the ID that determines which link the user is directed to. For instance if m=Just Phones then the user would be directed to the AffiliateFuture URL or if m=UKPhoneShop then the user would be directed to Tradedoubler URL Affiliate Link.
  • $link - This is the Affiliate URL we want to hide from our website visitors.
  • header() - This is a simple PHP redirect tag which simply directs the browser to the requested page. The requested page for us will be the $link URL.

Note - The first line with an empty '$m' variable is just a simple direct to our website homepage. This is to prevent a user typing in jump.php in the browser bar and expecting to be sent somewhere. This URL can be changed to an Affiliate Link if required.


Putting it all Together

In our Mobile Phone example site we have created hidden affiliate links from the links supplied by the network, thus inturn direct the visitor to the Merchant site without them seeing the URL.

So to get the process together we need to know the affiliate link and a '$m' value. So taking the merchant Just Phones, we have the following information:

Affiliate Link = This affiliate link should be entered into the PHP Jump Script file for the value $link:

{$link = "";}

We know what the Merchant is called, Just Phones, so it is easy to use this as the '$m' value to activate the Jump Script.

($m == "Just Phones")

Now we have to create the actual link that is clicked on our website navigation <a href="jump.php?m=Just Phones">Just Phones</a>. This is where the value of $m in the jump script is assigned.

This process can be repeated as many times as required in the jump script as long as the '$m' value is different each time. If you are promoting Commission Junction, BFAST or Linkshare it is virtually a must that you use a jump script of some kind to protect your affiliate commissions.

Another thing to note is that you had better make sure that the Merchant you are creating 'jump links' for permits you to do so. Failure to check on this could lead to commissions not being paid even if you generate sales!

Testing the Script

If you create any kind of jump script for affiliate links on your websites, ALWAYS check that the links are working correctly and are logging the click through. An easy way to accomplish this is to click the affiliate link yourself and then login to your affiliate control panel for that Merchant and check the stats to see if the click has been logged. Don't be too impatient, as a few affiliate programs don't update the click stats until the next day. Ensure you remember to check the clicks other wise you may not get your due commission on any sales made though that link if it does not function correctly.

Free Quote available for any custom PHP and Database Software, Contact Steve Dawson Today