matomo-org / matomo-log-analytics

Import any kind of server logs in Matomo for powerful log analytics. Universal log file parsing and reporting.
https://matomo.org/log-analytics/
GNU General Public License v3.0
227 stars 119 forks source link

Country guessing from browser language not working properly. #363

Open micichon opened 1 year ago

micichon commented 1 year ago

Hello!

Summary

I have a problem with Matomo trying to guess users location form web Browser. My application is not very complicated, that's why I want it to use default geolocation setting. However as much as geolocation works properly when I use the application on Android, It does not work when I try to use it on IOS. Matomo shows the message that it recognises the web language but does not set the localisation properly. I am scratching my head why that might be the case and I would appreciate all the help I can get.

Here Matomo is properly recognizing the location when using Android: image

And here is the same but when using Iphone: image

Note that I tried to change the browser languages to match and be different and it did not help.

sgiehl commented 1 year ago

Matomo basically detects the language based on the headers sent with the request. So this detection depends on the HTTP_ACCEPT_LANGUAGE. If iOS sends that as en, Matomo can't detect anything based on that, as English is a language spoken in too many countries.