# Creating contact with location

**URL:** <https://forum.mautic.org/t/creating-contact-with-location/26048>\
**Category:** Product Support\
**Created:** [November 12, 2022, 2:45am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048 "2022-11-12T02:45:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saidhasyim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/saidhasyim/32/6368_2.png) [@saidhasyim](https://forum.mautic.org/u/saidhasyim)\
**Post date:** [November 12, 2022, 2:45am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/1 "2022-11-12T02:45:52Z")

</div>

Mautic: 4.4.4.

Does anyone know how to assign a contact’s location (country) if I have the IP address (but dont have the location info)? I am inserting contact through API, but there is no built-in IP address field.

Thanks.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 12, 2022, 10:03am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/2 "2022-11-12T10:03:17Z")

</div>

You can add the country over API in the `country` field will do it.

---

<div class="post-metadata">

**Author:** ![saidhasyim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/saidhasyim/32/6368_2.png) [@saidhasyim](https://forum.mautic.org/u/saidhasyim)\
**Post date:** [November 12, 2022, 10:06am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/3 "2022-11-12T10:06:42Z")

</div>

Thanks @joeyk . That means I need to somehow get a country first before passing it to Mautic, right? There is no way to get Mautic to determine the country by IP, right?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 12, 2022, 10:07am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/4 "2022-11-12T10:07:54Z")

</div>

Not that I know if, but that is maxmind for.  
You can use the maxmind db to query it:  
[https://maxmind.github.io/GeoIP2-php/](https://maxmind.github.io/GeoIP2-php/)

---

<div class="post-metadata">

**Author:** ![saidhasyim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/saidhasyim/32/6368_2.png) [@saidhasyim](https://forum.mautic.org/u/saidhasyim)\
**Post date:** [November 12, 2022, 10:14am UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/5 "2022-11-12T10:14:53Z")

</div>

Ah. Thanks for that. I will check that

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [November 13, 2022, 10:14pm UTC](https://forum.mautic.org/t/creating-contact-with-location/26048/6 "2022-11-13T22:14:56Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
