# Mautic Hubspot Plugin creating Duplicate contacts

**URL:** <https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379>\
**Category:** Development\
**Created:** [September 6, 2017, 9:57am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379 "2017-09-06T09:57:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 6, 2017, 9:57am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/1 "2017-09-06T09:57:10Z")

</div>

Can someone help to confirm a potential bug. I am running Mautic 2.9.2 on my own server.  
  
  
  
We sync contact records between our Mautic and Hubspot CRM.  
  
  
  
We are finding that when an email address is updated for a contact in Hubspot the Hubspot Plugin is creating a second new contact in Mautic with the new email address rather than updating the existing Mautic contact record. This means that we continue to market to the incorrect/old email address in addition to the new email address within Mautic Campaigns.  
  
  
  
This is of course a big problem resulting in certain situations emailing someone who has replied to an email expressing interest (from a new address) for which we make a note of in Hubspot but who we then continue to market to their old address. It will be very hard to unpick where this has already occurred and we need to maintain duplicate contact records in Hubspot from now on as an emergency work around.  
  
  
  
I have been running test this morning and it has been consistent. Is this specific to my installation or can someone else replicate it?

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 6, 2017, 9:57am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/2 "2017-09-06T09:57:10Z")

</div>

Can someone help to confirm a potential bug. I am running Mautic 2.9.2 on my own server.

We sync contact records between our Mautic and Hubspot CRM.

We are finding that when an email address is updated for a contact in Hubspot the Hubspot Plugin is creating a second new contact in Mautic with the new email address rather than updating the existing Mautic contact record. This means that we continue to market to the incorrect/old email address in addition to the new email address within Mautic Campaigns.

This is of course a big problem resulting in certain situations emailing someone who has replied to an email expressing interest (from a new address) for which we make a note of in Hubspot but who we then continue to market to their old address. It will be very hard to unpick where this has already occurred and we need to maintain duplicate contact records in Hubspot from now on as an emergency work around.

I have been running test this morning and it has been consistent. Is this specific to my installation or can someone else replicate it?

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [September 6, 2017, 12:03pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/3 "2017-09-06T12:03:25Z")

</div>

how you sync contacts ?

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 6, 2017, 12:11pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/4 "2017-09-06T12:11:33Z")

</div>

Hi, via the Hubspot CRM Plugin / Hubspot API which is now a standard Mautic Plugin. My best guess is that Mautic (or the plugin) uses the email address as a unique identifier key for the contact record rather than the ID and therefore when it is passed an already existing contact with an updated email address it has no existing key to identify the contact as existing so it creates it as a new contact rather than simply updating the email address.

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [September 6, 2017, 12:21pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/5 "2017-09-06T12:21:39Z")

</div>

You just simply integrate the hubspot plugin , in mautic right? Did you set cronjobs after integration ?

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 6, 2017, 1:41pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/6 "2017-09-06T13:41:06Z")

</div>

Yes all working as it should. It is two way syncing and mostly working great - I do not believe this to be a setup issue. I think it is a limitation of the plugin but want to see if it can be replicated elsewhere to confirm this.

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [September 7, 2017, 6:05am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/7 "2017-09-07T06:05:27Z")

</div>

right

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 7, 2017, 7:17am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/8 "2017-09-07T07:17:51Z")

</div>

Is anyone using the Hubspot Mautic Plugin to confirm this issue? Is this the best place for my question? It is a big issue and will potentially be effecting everyone using this plugin.

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [September 7, 2017, 9:26am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/9 "2017-09-07T09:26:06Z")

</div>

@paulomcguinee

why don’t you try simple process that , cancel the Hubspot integration and again do integration and then checks.

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [September 7, 2017, 10:32am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/10 "2017-09-07T10:32:16Z")

</div>

@paulomcguinee  
You run a debugger on the application. If you do not know what I’m talking about then I recommend that you call some programmer / i could be. It is possible and likely that the problem is occurring when passing request data between Mautic-API or API-Hubspot. it may be a duplicate request in the code as a query in the Mautic database or in the integration as I said above.

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 7, 2017, 1:14pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/11 "2017-09-07T13:14:53Z")

</div>

I’d like to see first if this behaviour is the same for everyone. I expect it is. And therefore this is a limitation with Mautic/Hubspot API Plugin that I hope can be looked at by the community. I think I need to post elsewhere to find someone also using Hubspot API and see if they have the same issue.

---

<div class="post-metadata">

**Author:** ![Robmobius](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@Robmobius](https://forum.mautic.org/u/Robmobius)\
**Post date:** [September 8, 2017, 8:00am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/12 "2017-09-08T08:00:36Z")

</div>

Busy trying to duplicate…

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 8, 2017, 9:14am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/13 "2017-09-08T09:14:37Z")

</div>

Great let me know if you need any help with the process.

---

<div class="post-metadata">

**Author:** ![Robmobius](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@Robmobius](https://forum.mautic.org/u/Robmobius)\
**Post date:** [September 8, 2017, 2:09pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/14 "2017-09-08T14:09:58Z")

</div>

Added a contact to hubspot that already existed in Mautic. No duplicate created in Mautic

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 8, 2017, 2:12pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/15 "2017-09-08T14:12:54Z")

</div>

OK now go to that contact in Hubspot. change the email address to a new one. Then wait for it to sync to Mautic - my problem is that rather than sync the two records and update Mautic with a new email address you will get a new contact in Mautic and continue to have the same contact with old address too. Therefore duplicating Mautic contacts and creating the potential to market to someone who has replied.

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 8, 2017, 2:13pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/16 "2017-09-08T14:13:42Z")

</div>

Hopefully that is clear?

---

<div class="post-metadata">

**Author:** ![Robmobius](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@Robmobius](https://forum.mautic.org/u/Robmobius)\
**Post date:** [September 8, 2017, 3:30pm UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/17 "2017-09-08T15:30:30Z")

</div>

Yup - was able to replicate the error. It makes sense in that Mautic uses the email address as the basis to decide whether a record is unique or not. So a new email address would create a new record. I guess thats how the integration was written. Using an ID code would better but that assumes both apps use or can understand the same coding system?

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 11, 2017, 9:05am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/18 "2017-09-11T09:05:29Z")

</div>

Hi @Robmobius , I am pleased you have replicated the issue. In a working environment this functionality renders the Hubspot --\> Mautic sync unusable in many scenarios as you just cant have a situation where their is a potential to email someone who has got back to a previous campaign (via a different email) unless you maintain duplicate records or do not use their preferred email. Both workarounds have their limitations.

I have just checked through the Plugin Mapping and it is not possible to map the Hubspot Record ID to the Mautic Record ID. If this was possible and then the “Identifier Key” could be changed from Email to ID then that might be a solution. Do you know if there is a way to ask the Mautic development community to take a look at this issue/behaviour to see if it can be improved? - I would be willing to pay something towards having this behaviour “fixed”.

---

<div class="post-metadata">

**Author:** ![Robmobius](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@Robmobius](https://forum.mautic.org/u/Robmobius)\
**Post date:** [September 11, 2017, 9:26am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/19 "2017-09-11T09:26:29Z")

</div>

I think the best is to add the issue to the Mautic Github. That way the dev team (which I guess is any volunteer) can pick it up run with it if motivated to do so.

---

<div class="post-metadata">

**Author:** ![paulomcguinee](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@paulomcguinee](https://forum.mautic.org/u/paulomcguinee)\
**Post date:** [September 11, 2017, 11:54am UTC](https://forum.mautic.org/t/mautic-hubspot-plugin-creating-duplicate-contacts/9379/20 "2017-09-11T11:54:55Z")

</div>

I have done as you suggested - so fingers crossed! Thank you for your help.
