Geo-targeting XML feed
If you are able to parse XML, then this could be a good solution to geo-targeting the Custom Banner and the API.
If any traffic comes from a country which doesn’t have an eBay Partner Network Program that supports Custom Banner or the API, then the listings will default to UK.
This is the latest product from R.O.EYE’s Geo Suite. If you require any additional fields for other ePN tools or API calls, please email the address in the Support section and we will try to accommodate.
For reference, the supported territories are:
| Territory | Custom Banner ID | Global ID |
|---|---|---|
| AT | 3 | EBAY-AT |
| AU | 4 | EBAY-AU |
| BE | 5 | EBAY-FRBE |
| CA | 7 | EBAY-ENCA |
| CH | 14 | EBAY-CH |
| ES | 13 | EBAY-ES |
| FR | 10 | EBAY-FR |
| GB | 15 | EBAY-GB |
| IE | 2 | EBAY-IE |
| IT | 12 | EBAY-IT |
| NL | 16 | EBAY-NL |
| US | 1 | EBAY-US |
| DE | NULL | EBAY-DE |
| HK | NULL | EBAY-HK |
| MY | NULL | EBAY-MY |
| PH | NULL | EBAY-PH |
| PL | NULL | EBAY-PL |
| SG | NULL | EBAY-SG |
Implementation instructions
<?php //Get the IP address of the visitor $visitorIP = $_SERVER['REMOTE_ADDR']; //Calls the XML file $xml = "http://www.cgmlab.com/tools/geotarget/feed.xml?ip=$visitorIP"; $resp = simplexml_load_file($xml); //Prints the response print_r($resp); //Extracts the information from the XML file $countrycode = $resp->countrycode; $custombanner = $resp->custombanner; $globalid = $resp->globalid; //Prints out the variables taken from the XML echo '<br><br>The countrycode is: ' . $countrycode; echo '<br>The custom banner ID is: ' . $custombanner; echo '<br>The Global ID is: ' . $globalid; ?>
This XML feed will return information relating to the visitors current location. However, because it may be called and parsed by a server side language (for example PHP), the XML feed in those cases would always return the location of the webserver, as opposed to the visitor. To get round this issue, you can manually give the xml call an IP address. For example:
- http://www.cgmlab.com/tools/geotarget/feed.php?ip=212.169.0.1
(UK IP Address) - http://www.cgmlab.com/tools/geotarget/feed.php?ip=130.98.0.1
(French IP address) - http://www.cgmlab.com/tools/geotarget/feed.php?ip=206.125.48.1
(US IP address)
Schema
<ceres> <version>1.0.0</version> <country>United Kingdom</country> <countrycode>GB</countrycode> <custombanner>15</custombanner> <globalid>EBAY-GB</globalid> </ceres>
- version – The current version number
- country – The full country of the visitor
- countrycode – Two letter representation of the visitor’s country
- custombanner – The Program ID of the Custom Banner for the visitor’s location
- globalid – The eBay Global ID relating the visitor’s location for use in the API



© 2012 R.O.EYE Ltd
I was wondering how accurate this IP location tool is, since there are many IP to country databases out there on the web.
From today I implemented your php code so I am very curious what to expect
I already got an email from a regular visitor that things were missing/not working. It seems that for example this USA IP address: 50.108.63.89 returns an empty countrycode.