Integrating HubSpot with Microsoft Dynamics 365 empowers businesses to align marketing and sales data, streamline workflows, and enhance customer experience. This comprehensive guide will walk you through every step, from setting up basic syncs to creating advanced workflows using webhooks and middleware.
Whether you’re syncing contacts, leads, or campaign activity, understanding how these two platforms interact will save your team hours of manual work and eliminate data silos.
Why Sync HubSpot with Microsoft Dynamics?
Integrating HubSpot with Microsoft Dynamics 365 offers a multitude of advantages that significantly enhance business operations. One of the primary benefits is the unification of customer data across both marketing and sales departments. This integration ensures that all teams have access to the same up-to-date information, fostering better collaboration and more informed decision-making. Additionally, the automation of lifecycle updates and lead qualification syncs streamlines processes, reducing manual effort and minimizing the risk of errors. This automation allows teams to focus on strategic activities rather than administrative tasks. Furthermore, the integration improves reporting and forecasting capabilities by utilizing shared data models. This leads to more accurate insights and predictions, enabling businesses to plan more effectively and respond swiftly to market changes.
Common Integration Scenarios
There are several typical scenarios where integrating HubSpot with Microsoft Dynamics proves beneficial. One common scenario is syncing HubSpot contacts as leads in Dynamics. This ensures that potential customers identified in marketing efforts are seamlessly transitioned into the sales pipeline, enhancing lead management efficiency. Another scenario involves breaking syncs based on qualification status. This means that once a lead reaches a certain qualification level, the sync can be adjusted to reflect their new status, ensuring that only relevant data is shared between systems. Additionally, the integration facilitates the creation of new leads from the same contact upon lifecycle advancement. As contacts progress through different stages of the customer journey, new leads can be automatically generated, ensuring that sales teams have the most current and actionable information to work with.
Understanding CRM Objects: Leads vs Contacts
HubSpot Contacts vs Dynamics Leads
In HubSpot, you primarily deal with Contacts. Microsoft Dynamics, however, distinguishes between Leads and Contacts.
-
A Lead in Dynamics is a potential client or deal in early stages.
-
A Contact is an individual tied to an Account (Company).
Sync Conflicts and Challenges
Although you can natively sync both a lead and a contact, issues often arise because HubSpot treats each contact as a single email address within the system. In contrast, MS Dynamics allows the creation of 'duplicate' leads for various interactions, which can result in different opportunities. While these aren't considered duplicates within MS Dynamics, they are perceived as such during integration. If your business operates this way, you'll need to devise a workaround to manage this situation.
Initial Setup for HubSpot–Dynamics Integration
Connecting HubSpot and Microsoft Dynamics
-
Navigate to Settings > Integrations in HubSpot.
-
Use the Microsoft Dynamics 365 connector.
-
Authenticate with admin credentials from Dynamics.
One-Way vs Two-Way Sync Options
-
One-way sync: Data flows from one system to the other.
-
Two-way sync: Bi-directional updates for contacts, companies, and deals.
Keep in mind that you can only set the sync direction per object, not per field. So if you have sensitive fields that you need to sync into HubSpot but cannot overwrite, make sure you create a workaround through a workflow for example so you do not risk overwriting the field in CRM.
Start with email-based matching; later, shift to CRM record ID matching for more accuracy.
Managing Duplicate Leads and Contacts
Using Custom Properties to Manage Sync Behaviour
Create the following custom properties in HubSpot:
-
Send to CRM
(boolean) -
Date of CRM Lead Created
(date) -
Create New Lead
(boolean trigger)
These properties help control when a HubSpot contact should sync or stop syncing to a Dynamics record.
Testing "Do Not Match" and Lead Filtering
Use a one-off trigger to send a lead without matching existing CRM records. Ensure the sync criteria explicitly exclude contacts unless the condition is met.
Lifecycle Stage Handling Between Systems
Mapping Lifecycle Stages
Use workflows to ensure lifecycle stages such as MQL (Marketing Qualified Lead) and SQL (Sales Qualified Lead) match the appropriate stage in Dynamics.
There is a slight challenge that one lifecycle stage can only be synced to one object. So your MQL's can be leads or contacts, not both.
So, for instance, if you’re syncing a contact as a Lead, you can’t use that same field for Contact sync.
To work around this:
-
Use a modified lifecycle stage like Marketing Qualified Contact.
-
Once your lead is qualified, change the lifecycle stage from MQL to Marketing Qualified Contact. I also like using Sales Accepted Lead for this but that comes down the the culture.
Handling MQL and SQL Transitions
When a lead becomes qualified in Dynamics:
-
Update the lifecycle stage in HubSpot to "Marketing Qualified Contact".
-
Set
Send to CRM = No
to break the sync for that lead. -
Optionally, create a new Dynamics Lead from the same contact using a webhook for subsequent conversions.
Step-by-Step Workflow: Create a Lead in Dynamics from HubSpot
Workflow Enrollment Criteria
-
Trigger when:
Lifecycle Stage = MQL
AND Exclude from Lead Sync = True
Setting Internal Flags and Sync Filters
-
Set custom property:
Lead Creation Status = Queued for new Dynamics Lead
Triggering a Webhook for New Lead Creation
-
Webhook action setup:
-
POST Method
-
URL: Your Azure proxy endpoint
-
Headers:
Content-Type: application/json
-
JSON body:
{
"firstname": "friend",
"lastname": "",
"email": "",
"company": "",
"lifecycle_stage": "",
"source": "HubSpot"
}
-
Building a Secure Webhook Integration
Azure App Registration and Permissions
-
Register a new app in Azure AD.
-
Grant Dynamics CRM – user_impersonation permission.
Fetching Access Tokens Securely
Use the OAuth 2.0 Client Credentials Flow to fetch a token:
POST https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token
JSON Payload Structure for Lead Creation
Make sure the Azure Function parses incoming JSON and securely authenticates with Dynamics to submit the payload.