Routing eBay through the jump script possible?
Hi,
I would like to minimize the number of straight to affiliate and roverized(ebay) links appearing on my sites pages. The rewrite/tracking "jump.php" script works wonders with all affiliate programs but since eBay works a little differently through the "ebay.php" mod those links are direct to ebay.
Would it be better/easier to modify the jump script or to write a completele separate script to handle only eBay affiliate links? I'm sure this has been done before but not sure if anyone using Price tapestry has done this yet?
Any advice/insight/code examples to redirect ebay links is welcome.
Best Regards
Hi Steph,
To keep things neat it's quite straight forward to redirect URLs through jump.php. Passing URLs as a parameter however is fraught with difficulty, so I like to base64_encode() them before passing to jump.php in a ?url= parameter. jump.php can then be modified to check for ?url=, decode and redirect if present before going on to do it's normal checking for a ?id= parameter.
To do this, firstly in ebay.php look for the following code at line 12:
global $config_currencyHTML;...and REPLACE with:
global $config_currencyHTML;
global $config_baseHREF;Then, within the myEbayRecordHandler function, look for each instance of (there are 2):
$item["VIEWITEMURL"]...and REPLACE with:
$config_baseHREF."jump.php?url=".base64_encode($item["VIEWITEMURL"])Finally, in jump.php, look for the following code on line 2:
require("includes/common.php");...and REPLACE with:
if ($_GET["url"])
{
$url = base64_decode($_GET["url"]);
header("Location: ".$url);
exit();
}
require("includes/common.php");Hope this helps!
Cheers,
David.
Perfect, I got it working and base64 even helps obfuscate the rover url which is a good thing too.
Thanks David
In digging a bit deeper I'm finding it may be best to write a new "jump" page specifically for ebay because it could also implement some click filtering by user agent or banned IP and whatnot. eBay's Quality Control Program doesn't react well to bot attacks that ignore robots.txt and click every link. Dumping banned IP's and improper user agents to a blank page is a must.
I'll wait to hear your thoughts on this, has it been covered here before?