# How to identify anonymous contact via API

**URL:** <https://forum.mautic.org/t/how-to-identify-anonymous-contact-via-api/14219>\
**Category:** Product Support\
**Created:** [May 6, 2020, 8:10pm UTC](https://forum.mautic.org/t/how-to-identify-anonymous-contact-via-api/14219 "2020-05-06T20:10:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavvel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pavvel/32/1165_2.png) [@pavvel](https://forum.mautic.org/u/pavvel)\
**Post date:** [May 6, 2020, 8:10pm UTC](https://forum.mautic.org/t/how-to-identify-anonymous-contact-via-api/14219/1 "2020-05-06T20:10:28Z")

</div>

**Your software**  
My Mautic version is: 2.16.2  
My PHP version is: 7.1.33

**Your problem**  
My problem is:

Hello, I am trying to integrate my website with Mautic via API and I have the following problem. When some user views my website for the first time new anonymous contact is created in Mautic with his own ID which can be seen via in cookies. Now when someone converts into a lead for example by filling some contact form I want to save his email and other data to Mautic, but instead of identifying anonymous contact and merge data into it, Mautic creates a new contact with new ID so I lost information about what pages were seen by him before filling the contact form.

I cannot access ID from cookie because Mautic is installed on a different domain.  
Together with email I tried to send ‘ipAddress’ =\> $\_SERVER[‘REMOTE\_ADDR’] but it does not work.

How could get the ID of anonymous contact? Or maybe there is another way to merge data from contact form into anonymous contact?

---

<div class="post-metadata">

**Author:** ![olimits7](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/olimits7/32/3071_2.png) [@olimits7](https://forum.mautic.org/u/olimits7)\
**Post date:** [April 18, 2024, 2:24am UTC](https://forum.mautic.org/t/how-to-identify-anonymous-contact-via-api/14219/2 "2024-04-18T02:24:41Z")

</div>

Were you able to figure this out? I’m having the same issue now.
