Piwik Web Analytics is a self hosted PHP application that does exactly the same thing as Google Analytics: It tracks users that come to your websites, how often, where from, etc..
By default Piwik can recognise which country the user is from. If you want to have more precise location information, like the city you have to add an IP geolocation database.
- Download and decompress the MaxMind City Geolite database
- Upload it to the /misc directory in your Piwik root directory.
- Login to your Piwik instance and browse to “Settings”, then “Geolocation”
- Select “GeoIP (PHP)” and save your settings
Future visitors to your website will now be logged with an approximate (~40km radius ~60% of the time) city location.