@robles-design opened this Issue on December 15th 2020

I used the HTTP server modul on a hosted server until Matomo 4.0.0. After upgrading to 4.0.0 that doesn't work anymore and I installed the DBIP City Lite database. In the administration settings my location Siegen is recognized correctly (see screenshot), but if I go to Visitors > Cities there are no new entries for Siegen. I have tested it and the city shows up in the real time logs as Frankfurt am Main. Any idea?



@sgiehl commented on December 16th 2020 Member

I think this might actually the same as https://github.com/matomo-org/matomo/issues/16714#issuecomment-728144047
@robles-design could you check if the city is in the list without a region name maybe?

@robles-design commented on December 16th 2020

Yes the city is in the list without a region name, but only 3 times since Matomo 4.x.x. That must be more. And why is it displayed in the admin menu correctly (see screenshot in my first post) but counted as a wrong city (Frankfurt am Main) in the visitor log? Frankfurt am Main gets more counts than they really have and Siegen gets less in that case. And I think this will happen to many more cities.


@sgiehl commented on December 16th 2020 Member

@robles-design As you might have seen in the linked comment. Db-IP doesn't report region ISO codes in the free version, so we are trying to map the names to iso codes. But as your screenshot show DB-IP reports the name in english, so it can't be mapped to the ISO code, as the official ISO name is in German.
But the main difference is the GeoIP database you are using. DB-IP and Maxmind are having differences in the detection. So it might be possible that DB-IP reports another location. You could sign up at Maxmind and use their free database instead. That might solve your problem maybe.

@robles-design commented on December 17th 2020

@sgiehl I understand that it can't be mapped to the ISO code. What I don't understand is why my visit from the city Siegen (reported by the location test in the admin panel) is shown as a visit from the city Frankfurt am Main in the dashboard and visitors log. If it can't be mapped it shouldn't be counted as a wrong city in my opinion.

I found a solution for my case. As I mentioned I used the server module on a hosted server and wondered why it didn't work after updating to 4.0.0. Matomo told me that it is not installed and I thought the previous working server module is too old and needs to be updated to work again with the new Matomo version. But without server access I can't update it and installed DB-IP. Cause the server module is faster and I'm not happy with the actual location results I tried it again and got it working. All I had to do was changing the variables in the Matomo settings from MM_XXX_XXX to GEOIP_XXX_XXX ;-)

Thanks for your support,

@sgiehl commented on December 17th 2020 Member

@robles-design If you used the same IP for being tracked and the admin UI the location should actually be the same. Unless there is some kind of proxy in front of Matomo, that sends another IP or something like this.

Regarding changing the variables. That should work, as long as the data stored in those variables is actually GeoIP2 data.
Maxminds' GeoIP used FIPS codes for regions, which do not match the ISO region codes GeoIP2 is using. So if you variables are filled with GeoIP data, the tracked regions might be incorrect or missing

@robles-design commented on December 17th 2020

@sgiehl Yes, same IP and no proxy results in different cities in the admin UI and the Matomo stats. That's what I tried to say from the beginning. For me the HTTP server module is working now. If you need more information about DB-IP I can reactivate it for testing purposes.

@sgiehl commented on December 17th 2020 Member

@robles-design Do you have IP Anonymisation enabled? If so did you enable using the full ip for enrichment of visitor data? If not the tracking might use the anonymized IP for Geo IP lookup...

@robles-design commented on December 17th 2020

@sgiehl Yes it's enabled, but with the HTTP server module and in the admin UI it shows the right city with DP-IP also..

@sgiehl commented on December 17th 2020 Member

The server module always uses the original IP I guess, at least that is not controlled by Matomo as the data is provided by the webserver.
The admin UI is meant as demo and therefor uses the IP in request headers.

The tracking does not directly use the IP from header. If IP anonymization is enabled it might be anonymized before it's passed to the GeoIP database for detection unless using the anonyimized IP for enriching visitor data is disabled.

@robles-design commented on December 18th 2020

Ok, that makes sense. Maybe a hint in the admin location settings would be good for the users. Something like "DB-IP (and Maxmind?) will not work accurate if IP anonymization is enabled." I think users would benefit from that.

This Issue was closed on December 17th 2020
Powered by GitHub Issue Mirror