Skip to content

Regions might not be detected correctly when using free DBIP geolocation database #20527

@sgiehl

Description

@sgiehl

Context

When geolocation is enabled in Matomo, Matomo tries to detect and store the location of the visitor based on his IP.

Depending on the use location database, this may contain country, region and city details.

Countries and Regions are internally stored as iso codes.

Unlike most other databases the free DBIP location database does not include any region codes. Instead it only serves region names.
To be able to store the region details in that case, we try to look up the region code by it's name using a list of all regions.

This currently fails as in some cases our list is not up to date in other cases the database returns the name in e.g. another language or writing.

As the free DBIP geolocation database is the suggested default database, we should improve that detection/mapping.

This problem has already been reported in various other issues like: #19359, #19329, #19411, #16714

Expected Behavior

Regions should be detected correctly when using free DBIP location database

Current Behavior

Regions are only partially or not detected at all for certain countries.

Possible Solution

The detection of regions should be done a bit more fuzzy. In addition the list should also contain old names of regions, regions that have been removed from iso and maybe also some other names that are used by DBIP database.

A proposed solution can be found in #20420

@mattab @Stan-vw Might be good to prioritize this one into Matomo 5 as it might impact a lot on premise customers.
The proposed solution is almost finished. Might need a couple more hours to look it through again and maybe add some more tests.

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.c: TrackingFor issues related to getting tracking data into Matomo.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions