Monthly Archives: April 2018

Deleting Leads and Hubspot sync

Oh, the woes of SFDC and Hubspot lead/contact synchronization. There’s a lot going on in the Hubspot sync and a careful reading of their documentation is always wise.

One thing I have discovered over the years is that the Hubspot and SFDC databases get out of sync. Here is how that typically happens:

  • Hubspot contact reaches some state wherein it qualifies for the inclusion list
  • Hubspot contact syncs to SFDC as a new Lead
  • Inclusion list rules are written in such a way that if the lead becomes disqualified in Salesforce, the contact is removed from the inclusion list. Note that the Lead still exists in Salesforce.
  • Now, if the Salesforce Lead is deleted (and you have configured Hubspot to delete Hubspot contacts if the corresponding Salesforce Lead/Contact is deleted), the HubSpot contact won’t be deleted because it is no longer in the inclusion list.

So, where’s the problem?

Given the above, if the Hubspot contact fills out a Contact Us form or does anything else that re-raises the HubSpot score to become marketing qualified again; HubSpot will…

  • Add the contact to the inclusion list (because your rules enable it to enter)
  • Sync the HubSpot contact to Salesforce (HubSpot has remembered the corresponding Salesforce ID)
  • Discover that Salesforce deleted the Lead, and …
  • Because you have configured HubSpot to accept Salesforce deletions as HubSpot deletions…
  • Deletes the HubSpot contact – even though the contact just filled out a form!

How to resolve

First of all, if you are getting started, never ever allow a Hubspot contact to leave the inclusion list once sync’d to Salesforce. This way, if you delete a Lead of Contact in Salesforce, it will delete the corresponding HubSpot contact. Should that contact re-appear months later as marketing-qualified again; HubSpot will treat it as a new Contact and Salesforce will see it as a new Lead. Just what you want.

A more usual scenario is you have (tens of, hundreds of) thousands of bogus/spammy/obsolete Salesforce Leads that some bright-eyed, bushy-tailed Salesforce admin decides to delete. Bam! They’re gone from Salesforce and those still in the inclusion list are also vaporized from HubSpot. But the deleted Salesforce Leads not in the inclusion list won’t be deleted from HubSpot and the problems described above ensue weeks/months later.

What you need to do is:

  • Before mass deleting in Salesforce, create a CSV with the email addresses of all the to-be-deleted Leads/Contacts
  • Delete from Salesforce
  • This will delete from HubSpot any HubSpot contacts in the inclusion list (good!)
  • Export from Hubspot a CSV with all HubSpot contacts with email address as a column. Be sure to do this after the Salesforce deletes are done and the HubSpot sync has run
  • Do an Excel VLOOKUP (actually, use the fast VLOOKUP technique unless you plan on staring at your computer screen when you have > 50,000 entries) and find all the entries in your HubSpot database that were deleted from Salesforce in the recent purge. These entries need to become a static list that you will use to delete from HubSpot. Do this operation as fast as you can.
  • Then fix your inclusion list rules to always include any Hubspot contact ever sync’d to Salesforce, regardless of HubSpot score or any other value. You can use the “Salesforce Last Sync Date not equal null” as the filter.