eBay Geotargetted link script
As an eBay affiliate, one thing that always annoyed me with making links to eBay on my blog or website was the fact that they were links to items or search results for only 1 country. Making links to eBay UK and eBay US on the same page is timc consuming and just a hassle.
So thats why I made the eBay Geotargetted link script!
What with the eBay script do for me?
The script allows you to link direct to the eBay search results for a product using a common URL standard - but it will also detect the location of your visitor based on their IP address and then send them to their nearest eBay store!
This means that US visitors get to view products on eBay US (www.ebay.com) and UK visitors get to see items from eBay UK (www.ebay.co.uk). The same goes for other visitors from different countries.
You get to post 1 link to eBay which contains your eBay Partner Network campaign ID and the script does the rest!
Your eBay cookie gets dropped for the right country and will send your eBay Partner Network profits soaring!
Examples:
When you buy the script, it comes as a file called go.php so to activate the links, you FTP the file to the relevant place on your domain and then from your blog or website, link using the following URLs:
http://www.yourdomain.com/go.php?xbox+360+GTA4
The xbox+360+GTA4 part is the product you are searching for. Just change it to what you want to search for, separated by + and the script will do the rest.
The link will send the user to their nearest eBay store and show them a search result for "xbox 360 GTA4".
Custom CustomID field
The eBay partner network has a method of allowing you to track where your customers come from by using a field called CustomID. By default, the eBay Geotargetted Link Script takes the URL of the page that the link was clicked on, takes out the messy HTML code and tags and inserts that as the CustomID - up to a maximum of 256 characters.
If you want to use your own CustomID field instead of the referring URL, you can manually enter that information into the go.php file too.
Extending the script further
If you are comfortable with editing your .htaccess file on your hosting provider, you can add this line to further extend the capability of this script:
RewriteRule ^go/([^/]+)?$ go.php?$1 [QSA,L]
This means that any requests to http://www.yourdomain.com/go will be sent to the go.php file, along with the search parameters too. Heres the same Xbox 360 example we used earlier, but with the .htaccess method turned on:
http://www.mydomain.com/go/xbox+360+GTA4
My script even recognizes the need for SEO friendly URLs, so the following link will work too:
http://www.mydomain.com/go/xbox-360-GTA4
You can also rename the go.php to what ever you want! Make the relevant name changes to the line in the .htaccess too (if you want to use that method) and the go.php script becomes something more powerful and unique to your site:
http://www.mydomain.com/shop/xbox-360-GTA4
(file renamed to shop.php and .htaccess method with friendly URLs)
http://www.mydomain.com/recommends.php?xbox+360+GTA4
(file renamed to recommends.php and not using the .htaccess method)
http://www.mydomain.com/link/xbox+360+GTA4
(file renamed to link.php and using the .htaccess method)
For these examples, we would need to change the .htaccess as follows:
RewriteRule ^shop/([^/]+)?$ shop.php?$1 [QSA,L] RewriteRule ^link/([^/]+)?$ link.php?$1 [QSA,L]
Installation
1. You will need a host that supports PHP and you will also need FTP access to your domain to upload the file.
2. Purchase the eBay Geotargetted Link Script
3. Unzip and upload the 3 files via FTP to the root of your domain or blog:
go.php
geoip.inc
GeoIP.dat
4. Open the go.php file in a text editor and enter your 10 digit eBay Partner Network campaign ID into the line as follows:
$campid = "1234567890";
5. If you want to add your own customID, enter it between the quotes in the line as follows:
$customid = "";
See above for more information on the CustomID field and its usage.
6. Save the file - and start linking!
This script works great with the WordPress aLinks plugin by the way! (The aLinks plugin developers site is down at the moment, but you can grab the plugin here).
Testing
The eBay Geotargetted link script also allows you to perform testing and debugging too so you can make sure that it is going to do what you want.
To enable this, edit the go.php file and change the line as follows from a 0 to a 1:
$debug = 0;
Save the file and test a link and you will be shown a page similar to the following, showing debug information:
eBay Linking Script You are from GB - Therefore I am sending to you eBay GB And am using this link: http://rover.ebay.com/rover/1/710-53481-19255-0/1?type=3&campid=1234567890 &toolid=10001&customid=xbox-360-page&ext=xbox+360+gtaIV&satitle=xbox+360+gtaIV
Multiple Scripts
You can also run multiple scripts on your site if you need to use more than one eBay Partner Network campaign ID.
Just save the file as something else and change the script accordingly.
This would be a good way to perform "split testing" or have a site where more than one author could link to eBay using their own Campaign ID.
BUY!
This script is available to buy for the amazing price of only $9.99!

{ 11 comments… read them below or add one }
Mod purchased! Will let you know if I run into anything =)
how to find my CUSTOM ID? Can you explain step by step?Thanks
@hans
Hi there.
The custom ID field can be used in 2 different ways.
You can either let the script create the CustomID for you automatically based on the URL of the page the link is placed on – or you can enter the CustomID yourself in the go.php file if you want to.
You don’t need to “get a custom ID” or anything like that – you can install the script and use it “out of the box” without even considering changing the CustomID field.
The only use for the CustomID field is that it shows as a field on your eBay Partner Network earnings report for each transaction you earn money from and allows you to tell which page the link was on when it was clicked. You can use the information to identify popular pages, posts or links.
Note: You must be a member of the eBay Partner Network to use this script.
Tao,
I’ll install this today and let you know if there are any problems. I have stores that are WP on the root BANS in folder, and am also starting to use phpPro. Does the script go into the root of Wordpress in both cases?
Gerry
@gerrypo
Yes, you can just drop it into the root of the Wordpress or domain or BANS or what ever you like! Just as long as you link to it correctly:
http://www.mydomain.com/go.php
http://www.mydomain.com/blog/go.php
http://www.mydomain.com/blog/store/go.php
etc…
Hi,
Seems like an awesome tool. Forgive me for some stupid questions…. but….
If I understand correctly, does this mean that we can create just one campid and use it on several different sites and track it by changing the custid for each different site that we use it on?
Also, if there are no items in a country for a given search, does it default to US like the ebay link tool created within the ebay affiliate site does?
Thanks…
Lee
@Lee You can only use 1 campaign per file and 1 custom ID per file, but you can have more than one file loaded on your site if you needed to.
If there are no items available, it does not default to the US store – it only sends visitors to their nearest eBay store. In theory, you are more likely to get a future sale off the 7 day cookie from a local store.
Hi,
Does Megatao work with phpBay?
If you want to geotarget phpBay, see here:
http://keithjameslock.com/phpbay-pro-extended-manual-geotargeting/
This little script is separate to phpBAY/BANS and stuff like that.
Hi taoski,
Your eBay Geotargetted link script is look good I wish to buy that 2years ago…
Do you have any example websites using this script