APIs & Integrations

Kelciestokes
Member

Two-way Integration, Duplicate email issues

I have a question about our two-way integration with HubSpot & duplicate email addresses on our records. 

 

We send over data about each user, which populates in a user’s contact properties. This integration is based on each contact’s email address. In the past, an email address was unique to a contact in our Hubspot instance. Additionally, we sync from Hubspot. For example, we backfill our user’s table with each user’s Hubspot ID, which we pull from Hubspot.  

 

The issue we’re running into is that email address is no longer unique to a single Hubspot ID. We have many Hubspot ID’s with multiple email addresses associated with them.  So, when we send data to Hubspot via our integration the correct information may not be being displayed because our integration is based on an email address. We cannot use Hubspot ID since we backfill that information and it would not work for new users who haven’t had their data synced yet. Is there an alternative strategy we could employ?

 

We have contemplated strategies like ignoring users with null contact properties, but this would ultimately cause issues down the road when users legitimately update contact properties to a null value. Basically there doesn’t seem to be a good solution to this issue.  Is there a best practice for issues like this?

12 Replies 12
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @Kelciestokes,

 

I hope all is well with you 😄

 

Currently HubSpot automatically deduplicate contact based on usertoken (the hubspotutk cookie), or contact email address or contact object ID.

 

When trying to create another contact that has the same email, I'm able to see the following prompt:

Hold the phone! It looks like a contact with the email address testingapis@hubspot.com already exists.

 

This means that contact will still be deduplicate based on email address. That said, are you seeing contact with the same email address being created twice? If so, do you mind providing me with the particular contact email address? 

0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Thank you for your response! Basically, our problem is: 


We send data to hubspot in batches based on email address
A hubspot contact has multiple email addresses associated with it 


So, the data represented in the last batch sent to hubspot may not be the correct data since there are multiple email addresses.  We are not getting any error messages during the sync. 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @caryalan,

 

Do you mean that when you're sending data in batches, instead of having one contact one email address, all the email addresses is being associated to one contact?

 

In this case, do you mind sharing how are data being pass into HubSpot? What is the API endpoint that your team is using? Such as, Create or update a group of contacts | Contacts API.

0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Yes! That's it exactly. Since contacts have multiple email addresses the correct information is not necessarily getting synced. I believe we're using the contacts API. 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @caryalan,

 

I would expect that if you're using the Create or update a group of contacts | Contacts API and sending across two different emails, it'll create two contacts and not create it as one contact and associate the rest of the email addresses as secondary email.

 

I ran a test by sending the following body:

[
{
    "email": "testonetestone@test.com",
    "properties": [
      {
        "property": "firstname",
        "value": "Cy"
      },
      {
        "property": "lastname",
        "value": "Hg"
      }
    ]
  },
{
    "email": "testtwotesttwo@test.com",
    "properties": [
      {
        "property": "firstname",
        "value": "Codey"
      },
      {
        "property": "lastname",
        "value": "Huang"
      }
    ]
  }
]

to this endpoint: contacts/v1/contact/batch and I was able to see two contacts being created.

 

In this case, do you mind sharing with me the following:

  • The request URL
  • The POST body
  • The Hub ID
0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Also, is it possible to collect all of the secondary email addresses associated with a hubspot id through the contacts API? basically, can I get a list of all email addresses associated with a contact through the API?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @caryalan,

 

When retrieving contact details from the Contact API e.g. (Get a contact by its vid) you'll be able to get both the primary and secondary email addresses. 

 

It'll be under the identitify-profiles array and if it's a secondary email the is-secondaryproperty value will be true and if it's a primary email the is-primaryproperty value will be true.

0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Great. One more question for you. Can we add more event-level data to a hubspot event? For example, we have the event, but it only appears that it allows us to append it with contact properties. Can we add an event property? For example, 

"Customer bought a thing and it was $15" 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @caryalan,

 

Do you mind sharing how are you currently appending the event to the contact properties? 

 

Additionally, you can learn more about event here: Create custom events and Create clicked element events.

0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Apologies this is totally unrelated to the contacts question. We are using the events api to trigger events based on customer activities. For example, when someone buys a subscription it triggers our app to send an event to hubspot. 

however, we were hoping to append these events with additional details, such as the price of the product they purchased. I was looking at the documentation for the event API and it appears that we can only add additional  contact properties to the event 

 

https://developers.hubspot.com/docs/methods/enterprise_events/http_api?_ga=2.143291253.1737706125.15...

So, I'm wondering if it is possible to send additional details with the event or can I only send contract properties? 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Two-way Integration, Duplicate email issues

Hi @caryalan,

 

Currently, it is only possible to send over contact properties through this endpoint: HubSpot Events HTTP API | Enterprise Events API. That said, maybe one other suggestion that I'd like to recommend is to set the custom properties name to something like "Customer purchased item value" so that it is clear when user see the value of this property and they would know that that's the value for the purchased items. 

0 Upvotes
caryalan
Member

Two-way Integration, Duplicate email issues

Quick question. Is it possible to pull an account's primary email address through the Contacts API?

0 Upvotes