Clickbank Publisher Hacks, Part 1: Creating a Clickbank Hoplink Redirection Script
A close friend of mine is using Clickbank to run an affiliate program for his product, but with the upcoming arrival of a second product he wants to promote via Clickbank, he ran into a problem.
Clickbank lets you promote up to 50 products, but you only get one hoplink for your entire account… that is, no matter how many products you have, the basic hoplink your affiliates will use will always land on the same page.
The three ways to deal with this limitation are:
- Create a new Clickbank account for each product
However, this would mean paying a $50 setup fee for each product, and would require logging into Clickbank multiple times to check sales and stats, and worrying about multiple Clickbank cheques each month. - Create an intermediary page with a link to each of the products he has available.
It isn’t necessarily a bad idea to have a page like this, but requiring all prospects coming via an affiliate to go through an extra page before seeing the offer is bound to reduce conversions and cause confusion. - Use a script to create custom redirection to the appropriate products.
This was the route that offered the best potential. I found a number of scripts that did exactly this, ranging from $17 to $97.
Before recommending one of the available scripts, I decided to figure out how they worked, and I found the following information on the Clickbank site that made me quite confident that I could quite easily handle the scripting myself.
If you want to pass other parameters through the hoplink to arrive at the target URL we will pass up to 64 bytes of QUERY_STRING data through to the target URL.
For example:
http://bonnie.clyde.hop.clickbank.net/?ZZ=1&YY=123abC
Would redirect to…
http://clydes-website.com/script.php?hop=bonnie&ZZ=1&YY=123abC
Based on this info, it seems that all we need to do is create a new hoplink landing page that redirects based on a parameter added to the hoplink url.
So, rather than using only http://AFFILIATE.PUBLISHER.hop.clickbank.net, we need to use http://AFFILIATE.PUBLISHER.hop.clickbank.net/?prod=XXX where XXX is a variable indicating the product page to redirect to.
So, I’m going to create a new page that will serve as a primary hoplink on called hop.php
<?php
//hop.php hoplink redirection
//define url for product #1
$url1=”http://www.yoursite.com/product1″;
//define url for product #2
$url2=”http://www.product2url.com/”;
if ($_GET['prod'] == “1″)
{
header(”Location: $url1″);
}
elseif ($_GET['prod'] == “2″)
{
header(”Location: $url2″);
}
//if there is no product variable, go to the first product
//URL, since there are affiliates who started promoting
//the first product before this script was set up and
//we don’t want them to lose sales.
//if you have no prior affiliates, you might want to
//send people elsewhere if they arrive on a hoplink
//without a variable.
else
{
header(”Location: $url1″);
}
?>
You can grab the code from here.
Once you’ve got your page set up, you need to change your hoplink in the Clickbank publisher administration area, and create a page for affiliates showing them how to properly link to your products.
The proper hoplink for product 1 would be
http://AFFILIATE.PUBLISHER.hop.clickbank.net/?prod=1
The link for product 2 is:
http://AFFILIATE.PUBLISHER.hop.clickbank.net/?prod=2
Simple enough to create and manage if you’re not terrified of handling a little raw code now and then.


September 4th, 2008 at 12:47 pm
[...] far in this series we’ve created a way to redirect prospects sent by affiliates to oodles of different product sales pages from one clickbank account, and [...]
October 2nd, 2008 at 1:00 am
Thanks for the code and lesson on how to have multiple products w/o forcing the customer to a page full of choices. That’s just not good marketing.
I have done as you indicate and ?prod=1 works great. However, ?prod=2 sends redirects to the same prod #1 page.
The code follows:
I just can’t see why this isn’t working.
Can you help?
Any help is greatly appreciated.
Woody
October 2nd, 2008 at 1:04 am
I’ll try the code part again without the begin/end
(begin)
//hop.php hoplink redirection
//define url for product #1
$url1=”http://www.iramakeoverman.com/lp2/lp2.htm”;
//define url for product #2
$url2=”http://www.iramakeoverman.com/lp1/lp1.htm”;
if ($_GET[’prod’] == “1″)
{
header(”Location: $url1″);
}
elseif ($_GET[’prod’] == “2″)
{
header(”Location: $url2″);
}
//if there is no product variable, go to the first product
//URL, since there are affiliates who started promoting
//the first product before this script was set up and
//we don’t want them to lose sales.
//if you have no prior affiliates, you might want to
//send people elsewhere if they arrive on a hoplink
//without a variable.
else
{
header(”Location: $url1″);
}
(end)
October 3rd, 2008 at 6:49 pm
Hi Woody, It might just be a problem with the weird way wordpress is changing quotation marks and maybe other punctuation. I’ll see if I can upload a text file that might work better some time tonight. I know I’ve got the script running for two CB publisher accounts right now without problems.
October 24th, 2008 at 11:08 pm
This is a great idea. I wish I had thought of it…lol. I’m going to have to give it a shot with my next Clickbank project.
November 10th, 2008 at 12:53 am
I remember building a membership site that allowed people to do this in a GUI (Graphical User Interface) to make it easier. The product was called “Hoplink Hitcher”.
Then Clickbank said at that time that they were going to make this an integral feature, as it is the most requested feature from vendors. That was 4 years ago :>)
Ah well, great post. It is a simple solution to a truly unnecessary problem.
Good job!
Ronakd Davies
http://www.RonaldDavies.com
November 20th, 2008 at 6:39 am
[...] Clickbank Publisher Hacks, Part 1: Creating a Clickbank Hoplink Redirection Script [...]
November 22nd, 2008 at 9:40 pm
[...] far in this series we’ve created a way to redirect prospects sent by affiliates to oodles of different product sales pages from one clickbank account, and [...]
December 28th, 2008 at 3:52 am
[...] for your community, or taking a temp job. Pay $50 to become a Clickbank publisher, and then read this article on how to publish 50 different products through a single hoplink. Write 50 products, all tightly [...]