Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Get city, region, country name, lat/long, using via the API UserCountry.getGeolocation #3534

Closed
anonymous-piwik-user opened this Issue · 2 comments

3 participants

@anonymous-piwik-user

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
Owner

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
Collaborator

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

@anonymous-piwik-user anonymous-piwik-user added this to the 1.10 - Piwik 1.10 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.