How can I get the details for visitors' location


Piwik can only get visitors’ location by country, can we use get location more detailed, for example: country->city.

I found that there is “location_ip” in database, but the data is not the format :“XXX.XXX.XXX.XXX”, how can I kown the IP adress according to this data “location_ip”?

Hello, the link seems to be down. Can someone please fix it? Thanks!!

Hi, I’ve spent a long time searching for an answer to this. I need to search for specific IPs that may or may not be attacking a whole network of sites attached to my piwik install.

I’ve found the location_ip table, but the Ips are not saved in a format I can recognize or search.

Is there anyway I can have it shown in a standard IPv4 format? If not, what method can I apply to translate these entries into the format I need?


There are several ways to get visitor ID, see this FAQ (last point link to SQL to get IP) How to - Analytics Platform - Matomo

Thank you mate, I spent ages trying to find this!

For anyone else, this is what he was pointing to:

SELECT inet_ntoa(conv(hex(location_ip), 16, 10)) as ip, conv(hex(idvisitor), 16, 10) as visitorId FROM piwik_log_visit;