Blog

How to Manage Duplicate Contacts and Companies with the HubSpot Salesforce Integration

Written by Jonas | November 28, 2024

Introduction

When working with HubSpot and Salesforce, data duplication can create serious problems for your marketing, sales, and reporting. This guide will help you understand how to manage and reduce duplicates, without breaking your Salesforce-HubSpot integration.

These are 4 key concepts that you need to know:

1. Salesforce as the Source of Truth
Treat Salesforce as the primary source of truth, especially for company and account records. HubSpot automatically deduplicates Salesforce accounts into HubSpot companies using the Salesforce Account ID property. To avoid duplication issues, consider disabling automatic company association or creation in HubSpot. This is particularly important when syncing Salesforce leads to HubSpot. Since Salesforce leads are not associated with accounts, they won’t create a company in HubSpot during the initial sync. However, a duplicate company may later be created when a related contact or company is created in Salesforce.

➡️ Learn more about HubSpot deduplication

2. Merging Duplicate Contact in HubSpot
HubSpot allows you to merge duplicate contacts, even with the Salesforce integration enabled. Here’s how:

    • If the duplicate exists in both Salesforce and HubSpot: Merge in Salesforce first.
    • If the duplicate exists only in HubSpot: Merge directly in HubSpot.

➡️ Learn more about how to merge HubSpot contacts

3. Merging Duplicate Companies in HubSpot with Koalify
HubSpot does not support merging companies while the Salesforce integration is active. That’s where Koalify comes in. Koalify offers a merge-like behavior for company records, even when the Salesforce integration is enabled.

➡️ Learn more about how to merge HubSpot companies (when the Salesforce integration is disabled)

4. Avoid Disabling the Integration
HubSpot strongly advises against disabling the Salesforce integration to merge duplicates in HubSpot. Doing so may break the integration and disrupt the data sync. Instead, manage duplicates within Salesforce first and delete them in HubSpot or use Koalify to merge your duplicates. 

Salesforce Custom Properties in HubSpot

HubSpot Operations Hub provides data sync features to seamlessly sync data between the two platforms, allowing you to transfer data from Salesforce to HubSpot and vice versa.

  • Operations Hub Free: Supports standard mappings (e.g., Contact ID, Lead ID, First Name, Last Name).
  • Operations Hub Starter: Allows custom field mapping, enabling synchronization of unique Salesforce fields like date of birth, mobile phone numbers, as well as any properties created by your business that are unique to it.

These synchronized properties can be leveraged with Koalify duplicate rules to identify duplicates and define the primary record during merging.

 

How to Merge Duplicate Companies in HubSpot with Salesforce Integration Active

While HubSpot doesn’t support native company merging with Salesforce sync enabled, Koalify provides a workaround.

A. When Both Duplicate Companies Sync with Salesforce

Avoid merging companies with different Salesforce Account IDs—this can break the sync. To prevent incorrect suggestions, configure Koalify duplicate rules with filters like:

  • Company Name (& Domain Name / Phone / Street Address) & Salesforce Account ID

    • Company Name matches property Company Name
    • Company Domain Name matches property Company Domain Name
    • Salesforce Account ID matches property (or is unknown) Salesforce Account ID

B. When 1 Duplicate Companies sync with Salesforce

If one duplicate has a Salesforce Account ID and the other does not, make sure the synced record is retained as primary. Set a primary duplicate rule like:

Salesforce Account ID & Last Activty Date

  • Salesforce Account ID is known
  • Has last Last Activity Date

 

Merge Duplicate Contacts with HubSpot Salesforce Integration Enabled

It’s common to have duplicate contacts in HubSpot, particularly when using HubSpot for marketing purposes. These duplicates may exist even if each contact has a different email address. If you have HubSpot integrated with Salesforce and a duplicate corresponds to just one Salesforce lead or contact record, you can safely merge the duplicates in HubSpot.

A. When Both Duplicate Contacts Sync with Salesforce

  • Merge duplicates in Salesforce first to ensure the sync remains intact.
  • Deduplicating in Salesforce will automatically remove the duplicate in HubSpot if settings are correctly configured.
  • If you merge duplicates in HubSpot first, only the primary contact will continue syncing, and the secondary contact’s sync will stop.

B. When Only One Contact Syncs with Salesforce

  • Merge duplicates directly in HubSpot.
  • Koalify makes it easy to detect duplicates in HubSpot by matching property values, even when contacts have different email addresses. It also prevents merging contacts with different Salesforce Contact or Lead IDs by using these IDs as additional filters in the duplicate rules. By adding filters like "Salesforce Lead ID matches property (or is unknown)" or "Salesforce Contact ID matches property (or is unknown)," you can ensure that only contacts without conflicting Lead or Contact IDs are included.  These are some example rules:

      • First Name, Last Name & Company Name Match

        • First Name matches property First Name
        • Last Name matches property Last Name
        • Company Name matches Property Company Name
        • Salesforce Lead ID matches property (or is unknown)
        • OR Salesforce Contact ID matches property (or is unknown)

      • First Name, Last Name & Mobile Phone Match

        • First Name matches property First Name
        • Last Name matches property Last Name
        • Mobile Phone matches property Mobile Phone
        • Salesforce Lead ID matches property (or is unknown)
        • OR Salesforce Contact ID matches property (or is unknown)

      • First Name, Last Name & Phone Match

        • First Name matches property First Name
        • Last Name matches property Last Name
        • Phone matches property Mobile Phone
        • Salesforce Lead ID matches property (or is unknown)
        • OR Salesforce Contact ID matches property (or is unknown)

  • When merging contacts in HubSpot, it’s generally best to prioritize the contact synced to Salesforce as the primary record to ensure data continuity and proper synchronization. Koalify’s Primary Rules help you determine which contact to designate as the primary one during a merge.

    For example, if you are syncing both leads and contacts, you can create a rule to automatically prioritize the contact with a Salesforce Contact ID or Salesforce Lead ID as the primary record. This approach ensures the merged record remains correctly linked to Salesforce and avoids disruptions in data sync:

    • Salesforce Contact, Lead ID is known, Unsubscribed from all is not true

      • Salesforce Contact ID is known
      • Salesforce Lead ID is known
      • Unsubscribed from all email is none of True

Bulk merge Duplicate Contacts with the HubSpot Salesforce Integration Enabled

With these strict duplicate and primary rules in place, you can bulk merge duplicates using Koalify’s workflow action.

Set the following enrollment criteria:

  • Koalify is Primary Duplicates is equal to False
  • Koalify Duplicate Rules is any of
    • Koalify Duplicate Rules is any of First Name, Last Name, Company Name, Different Salesforce Contact ID 
  • Optionally add extra criteria on:
    • Salesforce Contact ID is Unknown 
    • Salesforce Lead ID is Unknown

Then, add the Koalify Workflow Action: "Merge Duplicate Contact"

Manually merge Duplicate Contacts with the HubSpot Salesforce Integration Enabled

For precise control, Koalify detects duplicates automatically and then enables you to manually merge duplicate records. When viewing a contact with a potential duplicate, you can easily merge or reject the suggestion using the actions button. 

Here is an example of a merge where the Salesforce Contact ID is used in combination with First Name and Last Name.

Additionally, here is an example of a merge where the Salesforce Lead ID is used in combination with First Name and Last Name.

After clicking the actions button, you will have the option to merge or reject the suggestion.