Skip to content
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

Visitor maps not showing regions correctly in most countries #13347

Closed
CGsama opened this issue Aug 25, 2018 · 10 comments
Closed

Visitor maps not showing regions correctly in most countries #13347

CGsama opened this issue Aug 25, 2018 · 10 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@CGsama
Copy link

CGsama commented Aug 25, 2018

I use the city db for geoip(php), all fine when using wordwide view. However, it couldn't show on reguion and city map. But correct at realtime map.
5 ac r9qwjo91 un 6d 2o
s37 x s73o3r0 yh5x0xamp
o6a xx h 0_snnmz k4

@sgiehl
Copy link
Member

sgiehl commented Aug 25, 2018

Are you using GeoIP 2 or GeoIP (Legacy)? Our map currently does not support showing regions in all cases for GeoIP 2, as it was not yet updated to support the ISO regions.

@CGsama
Copy link
Author

CGsama commented Aug 25, 2018

I'm using the GeoIP2(php). Thanks for clarifying that. And for my IP which in Canada, I can see the region map shows correct.

@parruc
Copy link
Contributor

parruc commented Sep 4, 2018

Same problem here: for Italy with GeoIP2 (php) I can see the cities correctly but all regions are marked as unknown.

@sgiehl
Copy link
Member

sgiehl commented Sep 6, 2018

For GeoIP2 it will still show regions correctly if the FIPS and ISO code for a region is the same. That applies for US, CA and some smaller countries. We are working on updated maps to fully support the ISO codes GeoIP2 is using...

@mattab mattab changed the title map not showing correct map not showing regions correctly in most countries Mar 19, 2019
@mattab mattab changed the title map not showing regions correctly in most countries Visitor maps not showing regions correctly in most countries Mar 19, 2019
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 19, 2019
@mattab mattab added this to the 3.13.0 milestone Mar 19, 2019
@mattab
Copy link
Member

mattab commented Mar 19, 2019

Since the upgrade to Geoip2, most of countries regions are not displayed correctly in the Maps.
Maybe we should consider disabling the feature of Region mapping on our maps, since it doesn't work mostly -> Moving into the milestone so we can take a decision.

Because It feels bad to have a non working feature it may be easiest to disable region mapping completely

or should we "partially disable region mapping" if it still work for some countries? @sgiehl

@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Mar 19, 2019
@mattab mattab modified the milestones: 3.13.0, 3.12.0 Mar 20, 2019
@mattab mattab modified the milestones: 3.13.0, 4.0.0 Jul 31, 2019
@thinkof4
Copy link

thinkof4 commented Aug 9, 2019

Will this bug ever be fixed, I mean this is an one year old issue...

@dfabreguette
Copy link

Same bug here ! Any workaround ?
Capture d’écran 2019-10-17 à 09 39 43

@mirkomaty
Copy link

mirkomaty commented Nov 13, 2019

@sgiehl, @mattab
What exactly is the problem with fixing this bug? These are the data we get from the maxdb:

{
"city": {
...
}
},
"continent": {
... },
"country": {
"geoname_id": 2921044,
"is_in_european_union": true,
"iso_code": "DE",
"names": {
"de": "Deutschland",
"en": "Germany",
"es": "Alemania",
"fr": "Allemagne",
"ja": "????????",
"pt-BR": "Alemanha",
"ru": "????????",
"zh-CN": "??"
}
},
"location": {
... },
"postal": {
... },
"registered_country": {
... },
"subdivisions": [{
"geoname_id": 2951839,
"iso_code": "BY",
"names": {
"de": "Bayern",
"en": "Bavaria",
"es": "Baviera",
"fr": "Bavière",
"ja": "??????",
"pt-BR": "Baviera",
"ru": "???????",
"zh-CN": "????"
}
}
]
}

As we can see, in subdivisions.iso_code an iso_code is provided. If your maps are based on FIPS codes, all you have to do is to provide a translation based on a file, which can be filled by the community. We are interested in the regions for Germany. The FIPS codes for Germany are

GM01_414_414_state_land___Baden-Wurttemberg__
GM02_414_414_state_land___Bayern__Bavaria
GM03_414_414_state_land___Bremen__
GM04_414_414_state_land___Hamburg__
GM05_414_414_state_land___Hessen__
GM06_414_414_state_land___Niedersachsen__
GM07_414_414_state_land___Nordrhein-Westfalen__
GM08_414_414_state_land___Rheinland-Pfalz__
GM09_414_414_state_land___Saarland__
GM10_414_414_state_land___Schleswig-Holstein__
GM11_414_414_state_land___Brandenburg__
GM12_414_414_state_land___Mecklenburg-Vorpommern__
GM13_414_414_state_land___Sachsen__
GM14_414_414_state_land___Sachsen-Anhalt__
GM15_414_414_state_land___Thuringen__
GM16_414_414_state_land___Berlin__

All we need is a file with entries like

GM02 BY

or

GM02_414_414_state_land___Bayern__Bavaria BY

whatever format your map expects. The task for a workaround is to provide an iso code and get a FIPS code.

If you gave me a hint, where I can find the map code I could try to provide that workaround.

That's what we can do now in V3 and an iso based solution can be done without haste for V4.

@sgiehl
Copy link
Member

sgiehl commented Nov 13, 2019

The problem is, that there is no exact mapping from ISO to FIPS code.
You can find a mapping from FIPS to ISO here: https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/GeoIp2/data/regionMapping.php

But it's not possible to invert the mapping for most of the countries. But it should be possible for Germany

@sgiehl
Copy link
Member

sgiehl commented Dec 9, 2019

Most regions should be shown correctly again with next release.
Closing this one in favor of #11929, as new maps should fix that finally

@sgiehl sgiehl closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

7 participants