@anonymous-matomo-user opened this Issue on November 11th 2012

User request:

Would be great to add a feature where i can use the piwik API to get what country a user is coming from based on ip address: 

Example: 

$url = "http://analytics.com/"; 
$url .= "?module=API&method=Actions.getCountry"; 
$url .= "&userIP=192.11.111.11; 

$fetched = file_get_contents($url) 

But I think more generally there could be a simple API function that will be a proxy to the GeoIP provider currently in use. This could have many interesting uses. The function should check for: Piwik::checkUserHasSomeViewAccess()

Keywords: geolocation

@mattab commented on November 20th 2012 Member

All info should be returned for a given IP adress, and would return an array containing country/country_code/region/region_code/city/lat/long/etc.

@diosmosis commented on November 20th 2012 Member

(In [7494]) Fixes #3534, add UserCountry.getLocationFromIP method as proxy for GeoIP functionality.

This Issue was closed on November 20th 2012
Powered by GitHub Issue Mirror