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:

Schema

<ceres>
  <version>1.0.0</version>
  <country>United Kingdom</country>
  <countrycode>GB</countrycode>
  <custombanner>15</custombanner>
  <globalid>EBAY-GB</globalid>
</ceres>

Comments

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*