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

**URL:** <https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000>\
**Category:** Product Support\
**Created:** [December 12, 2019, 8:17pm UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000 "2019-12-12T20:17:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steverobinson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steverobinson/32/174_2.png) [@steverobinson](https://forum.mautic.org/u/steverobinson)\
**Post date:** [December 12, 2019, 8:17pm UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000/1 "2019-12-12T20:17:57Z")

</div>

**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?

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [December 13, 2019, 10:20am UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000/2 "2019-12-13T10:20:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kuzmany](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kuzmany/32/390_2.png) [@kuzmany](https://forum.mautic.org/u/kuzmany)\
**Post date:** [December 13, 2019, 5:38pm UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000/3 "2019-12-13T17:38:39Z")

</div>

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

> <https://github.com/mautic/mautic/blob/4368fac19827a7aa08fac2f47f64070835c7a5e9/app/bundles/LeadBundle/Model/LeadModel.php#L509>

---

<div class="post-metadata">

**Author:** ![steverobinson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steverobinson/32/174_2.png) [@steverobinson](https://forum.mautic.org/u/steverobinson)\
**Post date:** [December 13, 2019, 5:54pm UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000/4 "2019-12-13T17:54:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![steverobinson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steverobinson/32/174_2.png) [@steverobinson](https://forum.mautic.org/u/steverobinson)\
**Post date:** [December 13, 2019, 8:59pm UTC](https://forum.mautic.org/t/has-ip-lookup-e-g-maxmind-always-overwritten-location-information-any-way-to-change-this-behavior/12000/5 "2019-12-13T20:59:14Z")

</div>

I created an issue in GitHub: [https://github.com/mautic/mautic/issues/8233](https://github.com/mautic/mautic/issues/8233)

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.
