@fdellwing opened this Issue on November 9th 2018 Contributor

If you view the visitor map on country level you are able to see city, but not state visitors.

matomo6
matomo7

Should be fixxed before #13687 is merged to not confuse people.

@fdellwing commented on November 10th 2018 Contributor

@tsteur Can you look into that? The states are clearly defined, as you can see on the right, but are shown as "unknown" on the map.

@tsteur commented on November 11th 2018 Member

I'm not so much into the maps. I reckon this might be because of the GeoIP2 update @sgiehl ?

@sgiehl commented on November 11th 2018 Member

Yes. That's likely caused by GeoIP2. Our map is quite outdate for some states and (except of USA and Canada) it's defined with FIPS country codes (which was used for GeoIP Legacy). GeoIP2 switched to ISO codes for all countries, which makes it impossible for nearly all countries to match the regions anymore.
We need to recreate all our maps to make the compatible again. But as our map generator doesn't work anymore and the JS lib we are using to show everything isn't maintained anymore we might need to build it from scratch. Already started with some first steps on that, but I currently don't have any time to move forward with that project. Hope to be able to do that till end of the year

@fdellwing commented on November 11th 2018 Contributor

Than I propose to hold #13687 back until this is done.

@sgiehl commented on November 11th 2018 Member

Btw. As the regions for Germany don't differ that much between FIPS and ISO you might be able to see quite accurate data when applying this change:

diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js
index 4df3681..5682781 100644
--- a/plugins/UserCountryMap/javascripts/visitor-map.js
+++ b/plugins/UserCountryMap/javascripts/visitor-map.js
@@ -1437,7 +1437,8 @@ $.extend(UserCountryMap, {
         "SVN": "region",
         "GBR": "region",
         "ESP": "fips-",
-        "USA": "p", "CAN": "p"
+        "USA": "p", "CAN": "p",
+        "DEU": "p"
     },

     // custom country label positions [lon, lat]
@fdellwing commented on November 11th 2018 Contributor

Will try that tomorrow at work.

@fdellwing commented on November 12th 2018 Contributor

The map is now colored, but the numbers do not match with the numbers to the right. As far as I can see, they at least correspond with the general high. Meaning: The highest number right is also the highest state on the map.

matomo8

@sgiehl commented on November 12th 2018 Member

That's because you are viewing different metrics: visits <> unique visits

@fdellwing commented on November 12th 2018 Contributor

Well, than it is just confusing. But better as before with no data on the map.

I can't tell, how this will look in other countries, but I would not merge it if there is any chance to do more harm than good.

@sgiehl commented on November 12th 2018 Member

refs #11929

@mattab commented on November 13th 2018 Member

@sgiehl applying such patch to fix region mapping sounds nice (didn't know this would have been possible...) :+1:
Could we maybe do this for a few other countries as well?
Otherwise as it seems to work, could we push this in core so regions in Germany map work soon?

@sgiehl commented on November 13th 2018 Member

That case works for Germany, but not for many other countries. But it would also break the map for those still using GeoIP Legacy

Powered by GitHub Issue Mirror