Hi
telize works.
I've had a look at the locatorhq API docs and I am not sure if this has any baring on why it isn't working but there are a couple of things:
In the file IpLocationLocatorhqExt.php there is this section:
$location = new IpLocation();
$location->ip_address = $trackModel->ip_address;
$location->country_code = strtoupper($response['countryCode']);
$location->country_name = ucwords(strtolower($response['countryName']));
$location->zone_name = !isset($response['region']) ? null : ucwords(strtolower($response['region']));
$location->city_name = !isset($response['city']) ? null : ucwords(strtolower($response['city']));
$location->latitude = (float)$response['latitude'];
$location->longitude = (float)$response['longitude'];
In the API docs some of these response params seem to be different to the above:
"regionName" For US/Canada this is the state value. For others this is the district/region value
"cityName" Auckland
"cityLattitude" Standard Lattitude
"cityLongitude" Standard Longitude
The issue that may well be causing my particular problem is the sending of the site/server IP address. My app is sat behind a firewall and load balancer which means my public IP is actually different to the one MW sees on its server. What would be the correct syntax to make MW send a particular IP?
$remoteUrl = '
http://api.locatorhq.com/?user=%s&key=%s&ip%s=&format=json';
$remoteUrl = sprintf($remoteUrl, $this->getOption('username'), $this->getOption('api_key'), $trackModel->ip_address);
I want to use LocatorHQ because in future I want to extend the MW extension so it pulls all the data they have such as OS, browser, device type etc. All very useful data for marketing purposes.