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
Geolocation wrong on internal network even with enable_language_to_country_guess=0 #18625
Comments
Hi @brandtmark matomo/core/Intl/Data/Resources/languages-to-countries.php Lines 19 to 60 in 1155273
But it still uses the country if it's defined in the language. Like I guess this could be clarified a bit better. Nevertheless, I guess you are actually looking for an option to disable falling back to the default provider if the GeoIP provider didn't have results, right? |
Hi @sgiehl Thanks for the explanation. Exactly. I would prefer that clients who access our websites from the internal network don't to show up as visitors from US, UK, etc. just because of their browser language. |
Should be quite simple to introduce a new config setting that makes this possible. I'll set up a pull request to do that. But can't promise when this will be included in Matomo. Likely not before 4.8.0, as 4.7.0-rc1 was already released. |
Wow - i didn't expect this issue to be addressed that quickly. |
Our websites are accessed externally and internally (with an IP from the local network range).
GeoIp is installed and enabled.
Despite having set enable_language_to_country_guess=0, the geolocation information for users from the local network is set based on their browser language and therefore totally wrong.
This seems to happen in Common::extractCountryCodeFromBrowserLanguage and I’ve got the feeling that this function does not respect the config value correctly.
Expected Behavior
When setting "enable_language_to_country_guess=0" in config, the country code should never be guessed from the browser language. It should be "unknown".
Current Behavior
Despite having enable_language_to_country_guess=0 set in config, the geolocation for users with local network IP addresses is extracted from the browser language resulting in completely wrong countries.
Possible Solution
The function Common::extractCountryCodeFromBrowserLanguage should respect the setting correctly
The text was updated successfully, but these errors were encountered: