HubSpotProImproved in 5.0+
Connect a HubSpot account to map submissions to contacts, companies, and deals. For new connections, use HubSpot (Service Key). Existing connections can follow the original HubSpot setup.
Please note this is a complete integration between Freeform and HubSpot and should NOT be used along with HubSpot's "Collected Forms" javascript-based feature. Otherwise, you may observe unintended behavior.
HubSpot (Service Key)New in 5.19.1+
Use HubSpot (Service Key) from the CRM provider list for new connections. If you're switching an existing form, copy its mappings to the new connection and test it before disabling the original.
Create and authorize a service key
Create a key in HubSpot under Development → Keys → Service keys. Grant read and write access for each object you plan to map. Freeform always needs crm.objects.contacts.read to authorize the key. HubSpot’s service key guide
| CRM object | Read scope | Write scope |
|---|---|---|
| Companies | crm.objects.companies.read | crm.objects.companies.write |
| Contacts | crm.objects.contacts.read | crm.objects.contacts.write |
| Deals | crm.objects.deals.read | crm.objects.deals.write |
In Craft, add HubSpot (Service Key) under Freeform → Integrations → CRM. Enter the key or a Craft environment variable that contains it in Service Key, then save and click Authorize.
Map fields and test a submission
Enable the new connection in the form builder's Integrations tab and choose which CRM objects to map.
- Contacts match by the mapped email address. If there’s no match, Freeform creates a contact.
- Companies match by the mapped domain, such as
example.com. If there’s no match, Freeform creates a company. - Deals are created per submission by default. Map Deal Name and Deal Stage. If you use multiple pipelines, also map Pipeline. Use HubSpot’s internal pipeline and stage IDs. To update the same deal each time, enter its record ID in Existing Deal Record ID.
Save the form, send a test submission, and check the mapped records and associations in HubSpot. Freeform creates default associations between the records it creates or updates for that submission.
Compatibility
The remainder of this guide covers the original HubSpot integration, which connects through the Access Token field. A working legacy Private App token can still be used with that integration. HubSpot’s legacy Private App announcement
Endpoints
Maps data to the following endpoints:
- Deals
- Contacts
- Companies
Does your project require something else? Contact Us
TrackingNew in 5.6+
Automatically supports the HubSpot tracking code if present.
Fields
Maps data to the following field types (of text/number string type only):
- Standard
- Custom
Duplicate Check & Update
A duplicate check on records is done in the following way:
- Check whether the Contact already exists:
- Check against Email address as the identifier.
- If there's a match, update the Contact with new values, where supplied.
- If no match, create a new HubSpot Contact.
- Check whether the Company already exists:
- Check against Company domain name, which is automatically generated by HubSpot from the Contact email address domain name.
- If there's a match, update the Company with new values, where supplied.
- If no match, create a new HubSpot Company.
- If a new Contact was created, link the contact to the Company.
- Create new Deal.
- Attach the Deal to existing or newly created HubSpot Company and Contact.
Setup Instructions
Prepare Freeform's end for Integration
- Go to the Integrations section in Freeform Settings (Freeform → Integrations).
- Find HubSpot in the list of service providers.
- Leave this page open and open a new tab to go to the HubSpot site...
Prepare HubSpot's end for Integration
If you already have a working legacy Private App token for this account, skip this step and use that token.
- In your HubSpot account, go to Development → Keys → Service keys. You can also find Service keys under Settings → Integrations.
- Click Create service key, enter a name, and select Add new scope. Select the read and write scopes for each CRM object you plan to map. Always include
crm.objects.contacts.readso Freeform can authorize the connection. - Click Update to save the scope selection, then Create and confirm.
- Open the new key. Click Show, then Copy.
A HubSpot super admin or a user with Developer tools access can create service keys. See HubSpot's service key documentation for details.
Finish the Integration on your site
- Flip back to the Freeform CP browser tab.
- Paste the service key or your existing legacy Private App token into Freeform’s Access Token field. Freeform adds the
Bearerprefix when it sends the request.
Additional Configuration
- IP Address Field (optional)
- If you want to have the user's IP address sent over to the Contact in HubSpot, you can specify the custom HubSpot Contact field handle to receive it.
- Append checkboxes field values on Contact update?
- If a Contact already exists in HubSpot, enabling this will append additional checkboxes field values to the Contact inside HubSpot, instead of overwriting the options.
- Append checkboxes field values on Company update?
- If a Company already exists in HubSpot, enabling this will append additional checkboxes field values to the Company inside HubSpot, instead of overwriting the options.
Click the Save button.
Authorize the Integration
- After the integration is saved, you will see an Authorize button appear.
- Click the Authorize button.
- If authorized successfully, you'll see a green Authorized status at the top beside the integration name.
Authorization checks that Freeform can read contacts. Verify field loading and record writes after configuring the form.
Configure the Form
To use this integration on your form(s), you'll need to configure each form individually.
- Visit the form inside the form builder.
- Click on the Integrations tab.
- Click on HubSpot in the list of available integrations.
- On the right side of the page:
- Enable the integration.
- Select the API endpoints you wish to map to.
- Map Freeform fields to the HubSpot fields as needed.