matomo-org / plugin-Provider

Reports the Internet Service Provider of your visitors as part of your Matomo Analytics
4 stars 6 forks source link

Provider shows ASN instead of Provider Name #28

Closed nasiralamreeki closed 1 year ago

nasiralamreeki commented 2 years ago

Just wanted to follow up and say the experience since changing data sources for provider info has been less than ideal. While the provider field is populating the provider data is providing the ASN handle.

Example of current scenario:

Provider: ASN-CXA-ALL-CCI-22773-RDC

Which is the handle for "Cox Communications"

The simple name Cox Communications is available through the source but Matomo for some reason is pulling the handle instead.

Also the provider field is clickable but is generating a url of http://[provider handle]

nasiralamreeki commented 2 years ago

@tsteur could we get some action on this? The provider plug-in is rather useless if every-time I want to see provider data I have to manually go look up and ASN handle to determine the provider of a visitor.

nasiralamreeki commented 2 years ago

@sgiehl will this be addressed?

sgiehl commented 2 years ago

@nasiralamreeki Which geo location database are you using to look up the asn/provider

nasiralamreeki commented 1 year ago

@sgiehl GeoLite2

sgiehl commented 1 year ago

Which GeoLite2 database? GeoLite2-ASN? That one only contains the ASN. All other lite database also don't contain the ISP afaik.

We are using this code to fetch the isp and org: https://github.com/matomo-org/matomo/blob/d1e15c23dc07f87fb959a29013a519898302b182/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php#L152-L173

The provider field is then populated with this code:

https://github.com/matomo-org/plugin-Provider/blob/33536d55ab7d0cbe53b4358e4ea75bcd5dbded98/Columns/Provider.php#L46-L63

I actually can't see any problems with that.

nasiralamreeki commented 1 year ago
  1. Matomo doesn't let you select a specific database to call rather your code does that it's not end user configureable.
  2. The steps for that are here https://matomo.org/faq/how-to/how-do-i-get-a-license-key-for-the-maxmind-geolocation-database/
  3. When I initially setup Matomo with the key it worked and provided provider names not ASN but awhile back you guys did some patch and thats when things stopped working properly.
  4. If end users follow your documentation the outcome should be that things just work and a provider name is provided but that's not currently the case.
sgiehl commented 1 year ago

Matomo doesn't let you select a specific database to call rather your code does that it's not end user configureable.

That's true, but that doesn't answer my question which exact database you have installed.

When I initially setup Matomo with the key it worked and provided provider names not ASN but awhile back you guys did some patch and thats when things stopped working properly.

The only change I can remember in the last year, was moving some detection code from core to the provider plugin, where it actually should always have been. But that should not have changed any results.

nasiralamreeki commented 1 year ago

I'm not sure which is installed that's not shown in the web interface and again everything has been configured specifically per your documentation so what whatever database is installed is the one your code calls using their.

sgiehl commented 1 year ago

Aren't you able to look up which mmdb files are located in the misc folder of Matomo? I'm really trying to help here. But without further details I won't be able to do so.

nasiralamreeki commented 1 year ago

I see the following image

sgiehl commented 1 year ago

Ok. That means that the GeoLite2-City database is used for fetch the location (city, country, region,...) and the GeoLite2-ASN database is used to identify the organisation/isp. As that database only provides the "autonomous system organization", there is nothing else we could use for detection. If you want to have the exact organisation/ISP you may need to purchase the ISP database from maxmind, as the free ASN database does not provide those data.

nasiralamreeki commented 1 year ago

How would I enable that? I already own the ISP database.

ASN is just what your app is calling via api because I have the ISP database purchased and the API keys have access to all products so it's really up to your app to call the right database.

sgiehl commented 1 year ago

So you did configure the automatic download of the ISP database in the UI?

nasiralamreeki commented 1 year ago

I configured it as mentioned a couple times now specifically how your documentation instructions. I don't see a option to automatically download the database I see a place to put a key and that's it.

sgiehl commented 1 year ago

Within the Matomo admin there is a geolocation configuration allowing you to configure automatic updates.

image

Which URLs do you have configured there? They should look something like https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=YOUR_LICENSE_KEY&suffix=tar.gz

Note: ensure not to post your license key here