-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Improve handling and detection of region codes and names #20420
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
Conversation
If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'. |
8a400c5
to
a1e14ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to fully revert the change to isoRegionNames.php
and let it regenerate since the content of it and the code relating to it changed gradually.
Since the version of the file is part of the PR here I don't see that as an issue.
Back to you @sgiehl if you want to ask Ben to have a look or merge as is.
Summary:
This PR provides the following improvements & benefits around regions:
Description:
The DB-IP lite database, which Matomo is currently using as default, does only provide region names in it's detection (no iso codes).
As Matomo only stores region codes in the database, we are trying to match the returned region name to the region names that Matomo knows about. This might fail if the region name returned by the geoip database doesn't match a known name, which actually seems to be the case quite often.
To improve the region detection, this PR adjusts the lists of known regions. Instead of only holding the latest set of iso region codes mapped to there current name, the array now looks like this:
By providing a list of alternate names it will in the future increase the accurancy when trying to match regions by its name.
To properly fill this new strutuce the command to update the region list has been adjusted. It now also includes an additional option to add names used in db ip database, that don't match known region names.
The region list included in this PR was built with this steps:
fixes #20527
refs #20368
Review