Mautic Community Forums

Has IP Lookup (e.g. maxmind) always overwritten location information? Any way to change this behavior?

Your software
My Mautic version is: 2.15.3
My PHP version is: 7.2

I noticed today that the IP lookup service (Maxmind free, in this case) is overwriting the city and state on contacts in the database, even if there is another value in there.

This means if a contact has a valid mailiing address in the system and they engage with the website from a city/state that doesn’t match their street address, they end up with an invalid address in the database.

Has anyone figured out how to use IP lookup without completely hosing mailing addresses?

I can’t reply to your specific question, but I’ve experienced data overwriting too with a Zapier integration via API, which would write over existing data.
Maybe something has changed in the way existing data is managed/protected?

Couldn’t rewrite.
There is condition If exists any of address1, city, zip, state, country, then skip update these fields from GEO location database.

Thanks for the code citation. I think I figured out what is happening, now I’m just concerned about how often it’s happening.

  1. known contact has full address set in 123 Main St, Chicago, IL 63012
  2. Anonymous contact visits web page from Cincinnati, OH
  3. Anonymous contact fills out web form and becomes known, with same email as known contact
  4. Contacts merge and resulting contact has address 123 Main St, Cincinnati, OH 63012.

Plausible? Does anyone know the rules for when two contacts merge which field values win?

I created an issue in GitHub:

I’m honestly not sure if this is a new bug or if it’s always been there. If it’s always been there, I’m not sure the best way to fix it.

Regardless, we have lots of issues with data integrity where an upload may contain city and state, but the record already has a full address and something inside of Mautic that would prevent a less complete address from ever updating a more complete address via merge or import would be a good thing in my mind.