Matomo and Geolocation, getting the location wrong from my Linux-machine

Hello,

I am using matomo, the latest docker image (Docker Hub) .
Matomo = 3.13.4
Setting it up according to the wizard.

But here seems to be something wrong with the ‘Visitor map’ ,
when I surf into the service attached on my Linux/ubuntu 19 from my wifi and login from a Windows-10 machine on the same wifi - the Linux is logged as a countrty=‘United States’-visitor and the Windows-10 is logged as country=‘Sweden’ . Both machines having the same IP in the matomo-log …
ON the Windows-machine I am using Firefox, on the Linux-machine I am testing this with firefox&chromium.
How can I get this accurated, I am in Sweden and I want both machines to register as ‘Sweden’.

Going to the ‘Diagnostics’/‘system check’ there is note regarding Geolocation
Geolocation works, but you are not using one of the recommended providers. If you have to import log files or do something else that requires setting IP addresses, use the PHP GeoIP 2 implementation and install [maxminddb extension. ](https://matomo.org/docs/geo-locate/)

  • Do I have to fix this ? and fixing this, does that involve a cost ?

Best, i

Hi,

As long as you have not set up GeoIP, Matomo can only guess the location and therefore maps the language of the browser roughly to a country.

So you have to go to the System->Geolocation settings on the admin page and set up which geolocation database should be downloaded. The default is the DB-IP and while it is a bit imprecise, it it free and licenced und a creative commons license.

You can also use the free maxmind db, but for this you need to sign up and agree to their strict license terms.

Thank you Lukas for your swift reply.
I’ll guess I will try maxmind db for the time being - ‘strict license’ does sound tough, I have not looked into that yet … could you explain - would this be your recommended path?

best, I

Hi,

Maxmind put the free databases behind a login and another license starting this year:

https://dev.maxmind.com/geoip/geoip2/geolite2/

Here are the license agreements:
https://www.maxmind.com/en/geolite2/eula

1 Like

Good update!

That sounds like a deal-breaker for me, at least right now …
I am doing this for a small service at our museum right now, (as a test … wanting to pitch the idea to the managers), I think it would be a mistake for us to get tangled in licenses - rather have someone look at the meaning before I make a technical choice.

seeing the start of the section under ‘Geolocation’

if I follow those steps, would the geolocation improve ?

best, i

Hi,

Therefore you can simply use the db-ip free database as it is freely available under the creative commons license (the URL is the one Matomo automatically suggests)

Instead of doing it manually, you can also use the automated updater at the end of that page.

1 Like

Thank you Lukas!
This is working now, it should be a good demo-case for the staff at the birdringing-unit - it is their application, Birdrecoveries-at-nrm .

best, ink

Hello,
Did install the ‘db-ip free database’.
After that installation, I can see that my linux/ubuntu machine (English browser) now has a Swedish-origin and not a US-origin.
Some machines, getting the wrong location - I can see that my colleague surfed in to the service this morning from his linux/Fedora machine … he is located here in Sweden but his location is USA ( he surfed in from his workplace, IP-address 172.16.0.0)

Best, i

Hi,

172.16.0.0 is not an IP address on the internet. The whole 172.16.0.0 – 172.31.255.255 address range is reserved for private use (so IP addresses inside local networks). Obviously you can’t geolocate them as everyone can be using them inside their local network worldwide. I guess your colleague is sitting in the same network as the server and therefore the server doesn’t see his public IP address.

1 Like

So true, did not think about that - working from home myself these days

best, i