Merge API Contacts with Anonymous Contact

Your software
My Mautic version is: 3
My PHP version is: 7.3.29
My Database type and version is:

Your problem
My problem is:

I am creating contacts through Zapier whenever a new contact is created in another software. My issue is that when this new contact is created it doesn’t merge with an anonymous user. I am tracking website and page visits so I know that it would have captured the IP. I have added an email with a form to fill for double opt in thinking that it would then recognize and sync the IP’s but it doesn’t seem to do that either.

How do I get this to sync? It is important to capture that activity.

These errors are showing in the log: None

Steps I have tried to fix the problem: Tried sending an email with a form to try and recapture data

Mautic doesn’t merge anonymous users if you push in email address via API. Imagine - how would Mautic know who’s email address is it? You need to associate the email first (since API call will only try to match via email) and then launch the Zapier API call.

You can do this different ways:

  1. Use a Mautic form (The JS will take care of it.)
  2. Use a tracking pixel, where you inject the email (more you can find in the docs, but for this you need the email first)

if the form doesn’t work, look for Javascript errors on the form page.

So what I did was create a campaign that sends an email to users created by the API. It has a form that asks them to confirm their email address and opt in for future communications. Once they fill this form would Mautic then match to an anonymous user?

No.
Because they are already an identified user :slight_smile: You identified them via API. They have an email.
When they open the email (and fill out the form) they will be matched with the contact you created with API and all future action will be recorded.
They will have an anonymous past history, recorded as an anonymous user. Which will be not merged, because Mautic primarly matches via email, and the email exists, since you added via API.
Does it make sense?

There has to be a way to solve this. I’ve seen others posting about this issue as well. If I want to score based on engagement I must be able to score engagement before they became a known user.

Sure.
The solution is to use the proper tracking:

  1. Use a form for identifying a contact.
    The JS in the form will make sure your contacts are merged

  2. Fire a tracking pixel before you pass the data via API:
    http://example.com/mtracking.gif?email=mark.z@facebook.com

  3. Use javascript after populating the form:
    (see description in the docs)

More info:

Secret option number 4: you can have a script, that checks matching IP and merges the contacts together. I found that all previous versions are better then this.