Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ultimate way for ClickBank Vendors to handle removal of the hoplink
10-07-2009, 02:27 AM
Post: #1
Ultimate way for ClickBank Vendors to handle removal of the hoplink
This code helps your affiliates to avoid showing their hop link on your sales page and also should reduce the amount of people removing or altering the referring affiliates id.

PHP Code:
/* Script to remove ClickBank hoplink from URL and put it in a cookie
/* Author: Ned Storm
/* Version: 1
/* 6th October 2009
/* http://aweconsulting.co.uk
/*
/* this script should be included in the head section of a web page as follows:
<script type="text/javascript" language="JavaScript" src="hotlink.js"></script>
/*
/* The hop value is stored in qsVals.hop
/*
/* Code to add to a web form:
<script type="text/javascript" language="JavaScript">
document.write('<input type="hidden" name="hop" value="' + qsVals.hop + '"/>');
</script>
/*
/* Licence: Creative Commons Attribution-Share Alike 3.0
/* http://creativecommons.org/licenses/by-sa/3.0/us/
*/

// Change this value to your hoplink
var defaultHop "YOURHOP";

var 
qsVals = new Array();
var 
query window.location.search.substring(1);
var 
parms query.split('&');
for (var 
i=0i<parms.lengthi++) {
    var 
pos parms[i].indexOf('=');
    if (
pos 0) {
        var 
key parms[i].substring(0,pos);
        var 
val parms[i].substring(pos+1);
        
qsVals[key] = val;
    }
}

// check for hop value
if (qsVals.hop != null) {
    
// Set cookie to remember the hop value
    
if (document.cookie.search(/hop=/) < 0) { // No cookie yet
        
var theDate = new Date();
        var 
oneYearLater = new DatetheDate.getTime() + 31536000000 );
        var 
expiryDate oneYearLater.toGMTString();
        
document.cookie 'hop=' qsVals.hop ';expires='expiryDate;
    }
    
    
// If the cookie was successfully set, redirect the page to remove the hoplink from the url
    
var url "" window.location;
    if (
document.cookie.search(/hop=/) >= 0top.location.href url.split("?")[0];

} else 
qsVals.hop defaultHop;

// Look for cookie
if (document.cookie.search(/hop=/) >= 0) {
    var 
cookies "" document.cookie;
    var 
hop cookies.match(/hop=([a-z0-9]+);?/i);
    if (
hop != nullqsVals.hop hop[1];
    


Internet Marketing Software
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: