matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.3k stars 2.59k forks source link

Support multiple geolocation databases #15352

Open tsteur opened 4 years ago

tsteur commented 4 years ago

It could be useful, for detection of more IPs, to support multiple geolocation databases.

For example If not found in db-ip city, then check maxmind city, then check db-ip country, then check maxmind country. It would only look in another DB if one DB didn't find any result. The order where it looks would depend on the order the different DB urls are configured.

Not too important but thought I create issue anyway. Noticed MaxMind city DB contains for example double the amount of DB-IP IPv4 addresses by the looks, while DB-IP seems to contain more IPv6 addresses. Combining both would maybe be able to detect more DBs.

I suppose it be even enough if this could be configured through DI or config and maybe not in UI as it is maybe rather advanced.

sgiehl commented 4 years ago

There was a plugin for such a thing. Not sure if it works with latest Matomo: https://github.com/ThaDafinser/Piwik-GeoIpChain

tekhnee commented 3 years ago

Picking up on this excellent topic:

As the Matomo admin page explains, MaxMind's Apache/NginX extenesion, which purportedly provides the best results, “can only be used with normal browser tracking” — not for such things as tracking via API calls from a server app.

It should be possible to select different methods for browser tracking and API tracking, so that one might use MaxMind for browser tracking and IP2Location for the API calls.

Thanks.