How to enable GeoIp settings on Piwik Location & Provider

I’am working on VPN environment.I want to track the GeoIp Location,Region,City and country on Piwik(Location& Providers).While accessing my application it is giving only North America and USA for Country and region.Please help me out how to enable these things on piwik?

See how to setup geolocation at Geo Locate your visitors - Analytics Platform - Matomo

Hi Matt,

Thanks for your reply.
We have already followed the Geoip setup guide and we have installed the dat files.
Currently we have the ip address for some other country but in the Location provider its showing as United States.
Let us know if anything is missing.


Go back to Settings -> Geolocalisation and double check to see if you got a green “Installed” near the radio button about your Geo provider plugin and also have a look on the right to see something like this:

"Note: The 'geoip.custom_directory' PHP ini option is set to '/var/lib/GeoIP/'.

This GeoIP implementation has access to the following types of databases: City."

You see it says on the last line that the “City” database is visible and ok (even if not in the standard directory.)


Ya …we got the option as Installed and we have selected the radio button.But still there is no change.

Please find attached screen shot of the issue we are facing.
The country and continent is always United States and North America even if we access our application from India,where as other field are unknown.


Having the same issue. My GeoIP is configured and it detects the Country and City GeoIP dat files, but all of the hits from India are registered as USA.

If you got to this kind of site is the information correct ? From the server too ?

Are you Apache logs showing your IP if you visit your Piwik-enabled site? Maybe a proxy is “eating” the information meaning it’s not forwarded to your Piwik/Apache server ?


I’ve come to understand that the issue may be related to everything being internally hosted on our intranet. Both the website we are tracking and the Piwik instance are hosted internally, and the IP addresses being logged by Piwik are the intranet IP addresses vs the public external IP address that GeoIP is meant to track.

Is there a good workaround to this issue that Piwik officially recommends?

A good solution to this would probably replacing the getIpFromHeader() function in IP.php to a function that calls an externally hosted API that will then return the calling remote IP address.