Country detection via language: How does it work?

In its easiest form, Piwik uses the browser language to detect the country where the user is located. I am wondering how exactly this mechanism works. Is it using the HTTP Accept-Language header, or does the JavaScript code send the language based on the navigator object’s language properties?

In case someone finds the post:

Do not guess country based on the browser language · Issue #9251 · matomo-org/matomo · GitHub

1 Like

Thanks for the info and linking the Github issue! :slight_smile: