Mautic Community Forums

Updating a contact's Location after Maxmind database download

I realised my Maxmind database file wasn’t updating. After adding in my license key, I can now download the maxmind database file no problem. But I’m left wondering - is there a way to update the Location (country/city) of existing contacts in my system?

There doesn’t seem to be a cron method available for this. But I have over 8000 contacts with the city/country fields missing. Now maxmind is properly set up, I’d like to populate these fields.


My Mautic version is: 3.2.4
My PHP version is: v7.3.27
My Database type and version is: Ver 15.1 Distrib 10.3.27-MariaDB

Anonymous contacts I assume and not your identified contacts? I’m not aware of a way to retroactively update IP location.

Thanks for the reply EJL.

I’m referring to identified contacts. Specifically, 1k+ contacts who’ve already submitted a ‘sign up for a newsletter’ form, with name +email.

@pjrobertson Interesting problem!

I think there is no ready to run solution in mautic.

The geocoding for the ip address is only done during the page hit processing:

The geocoding is only happening if you disabled ip anonymization (anonymize_ip) and the geocoding details are persisted in the ip_addresses Database Table (under ip_details).

I got a similar problem last time and I used an external tool to geocode just the ip adresses to the countries and then imported the data back into the database.

(i used Bulk IP address lookup | Batch IP checker | WhoisXML API for the geocoding but there are others )

Or maybe you use a tool like this on github GitHub - lexmartinez/ip-geocoder: Find geocoding information from IP address - Powered by and script your own solution.


1 Like