Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anonymous-matomo-user opened this issue Nov 11, 2012 · 2 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

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
Copy link
Member

mattab commented Nov 20, 2012

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
Copy link
Member

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants