---
title: Integrate HubSpot
slug: data-platform/docs/integrate-hubspot
docTags: 
createdAt: 2026-08-10T12:05:16.000Z
---

:::hint{type="info"}
**Note**

The terms *audiences* and *segments* are interchangeable. Optimizely has updated all *segments* to *audiences* on the **Audiences** page and is updating the UI on other pages. See  [Understand audiences](docId\:v-gHiL9jfINBey-4QNtFM) to get information on audiences.
:::

Sync your HubSpot contact data and email events (sends, opens, clicks) to Optimizely Data Platform (ODP). You can also sync your ODP audiences and customer data to HubSpot for email and workflow targeting and customer profile data enrichment.

After you complete the configuration, this integration imports HubSpot contact and email data from the last 90 days, with the option to import all historical email events (one time only).

## Update API app consent setting

You only need to complete the instructions in this section if your app consent setting for the API channel is set to **Opted Out**. This setting must be set to **Opted In** for this app to successfully send data.

1. Go to **Settings > App Consent Settings** in ODP.
2. Set the **Api** app's **Default Consent** to **Opted In**.

::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/ReEqOwz9ep8rHhK3HVmLw_odp-app-consent-setting.png" size="90" width="1054" height="909" isUploading="false" darkWidth="1054" darkHeight="909" showCaption="false"}

3. Click **Update Consent** in the confirmation prompt.

## Sync data from HubSpot to ODP

This part of the configuration imports your HubSpot contact data and email events to ODP.

1. Go to **Data Setup > App Directory** in ODP.
2. Select the **HupSpot** app.
3. Click **Install App**.
4. On the **Settings** tab, click **Authorize** and follow the prompts to authorize your HubSpot account's connection with ODP. When complete, you are redirected back to ODP.
5. Go to **Data Setup > Integrations > AWS** and copy the **Key ID** and **Secret Access Key** values.

   ::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/rMP7BPwMjUAzbjZtJN6sZ-20260720-145646.png" size="100" isUploading="false" showCaption="false" width="1161" height="247" darkWidth="1161" darkHeight="247"}
6. Go back to the HubSpot app settings, paste the values in the corresponding fields, and click **Save**

   ::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/rVz8IZ66n1Gf4836Dt0wf-20260720-145646.png" size="100" isUploading="false" showCaption="false" width="842" height="591" darkWidth="842" darkHeight="591"}
7. Enable the HubSpot objects in the **Sync** section that you want to sync to ODP and then click **Save**.
   - **Contacts** – Syncs contacts nightly and updates the ODP customer profile. You must configure the contacts field mappings in the corresponding **Contacts** section.
   - **Email Events** – Syncs email events (sends, opens, clicks) hourly and updates the ODP customer profile. To sync historical email events from over 90 days ago, which you can only do one time, click **One-Time Historical Email Events Import**.

     ::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/oSHobMs6aI4sNRlt67N9U-20260720-145646.png" size="90" isUploading="false" showCaption="false" width="664" height="228" darkWidth="664" darkHeight="228" position="center"}

### Contacts field mapping

The **Contacts** field mapping section includes a table that lists the HubSpot fields that sync to ODP by default. You can add field mappings if you want to sync additional fields that are not listed in the table. Repeat these steps for each field mapping you want to add:

1. Expand the **Contacts** field mapping section.
2. Select the HubSpot field from the **HubSpot Contact Fields** drop-down list.
3. Select the ODP field from the **ODP Customer Fields** drop-down list that you want to map the HubSpot field to.

   :::hint{type="info"}
   **Note**

   If the HubSpot field does not have a corresponding field in ODP, you must first [create that custom field in ODP](docId\:xSe13VUhsS-w2QE-GUxIZ).
   :::
4. Click **Save Field Map**.

::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/FDhB0L7t87roFTpA7sOQw-20260720-145646.png" size="100" isUploading="false" showCaption="false" width="916" height="647" darkWidth="916" darkHeight="647" indent="3"}

5. Click **Import All Contacts** after you configure the field mappings to import all HubSpot contacts with the fields you configured.

   :::hint{type="info"}
   **Note**

   The contact data syncs nightly, but you can manually import all contacts at any time.
   :::

You can delete custom field mappings. Repeat these steps for each field mapping you want to delete:

1. Expand the **Contacts** field mapping section.
2. Select the field mapping you want to delete from the **Field Map** drop-down list.
3. Click **Delete Field Map**.

   ::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/0zG3lWmDtEslHHXakoDCk-20260720-145646.png" size="100" isUploading="false" showCaption="false" width="638" height="120" darkWidth="638" darkHeight="120"}

## Sync data from ODP to HubSpot

After you configure the app, you can set up an activation in ODP to sync your customer data from ODP to HubSpot.

1. Go to **Activations > Overview**.
2. Click **Create New Campaign**.
3. Click **One-Time** to sync your audiences and data once. To set up an automated, recurring sync, click **Behavioral**.
4. Click **Create From Scratch**.
5. Enter a name for your activation that represents the data you are syncing to HubSpot (for example, *HubSpot Data Sync*).
6. Select your desired audience and click **Apply** or click **Create New Segment**, select your desired audience conditions, and click **Save**.
7. (Optional) Adjust the **Enrollment Rules**.
8. Expand **Touchpoints**.
9. Click to edit **Touchpoint 1** and select **HubSpot**.
10. Complete the following fields in the **Configure** section:
    - **Sync as Marketable Contacts** – Toggle **on** if you want your ODP contacts to be Marketable Contacts in HubSpot. If not, toggle **off**.
    - **Target** – Select **Contact List** if you want to sync to a HubSpot list or select **Workflow** if you want to sync to a HubSpot workflow.
    - **Contact List** or **Workflow** – The name of this drop-down list matches what you selected for the **Target** field above. Select either the HubSpot contact list or workflow to which you want to send your ODP contacts.

      :::hint{type="info"}
      **Note**

      You must first set up either a static list or a workflow in HubSpot before you can select it in ODP.
      :::
    - **Primary Key** – Defaults to `{{customer.email}}`.
    - **Number of Additional Fields** – (Optional) Select the number of additional HubSpot data fields you want to sync (up to 20).
      A drop-down list and input field display for the number of additional fields you selected. In each **Field #** drop-down list, select the HubSpot field you want to populate. In each corresponding **Field # Value**, enter the ODP field you want to send to the selected HubSpot field. For example, if you selected *Company Name* from the **Field #** drop-down list, enter  for the corresponding **Field # Value**.
11. Click **Save** and then click your activation name in the breadcrumb trail.
12. In the **Touchpoints** section, click **Select start time and schedule**.
13. For a recurring sync (behavioral campaign), complete the following settings, then click **Apply**:
    - **Recurring or Continuous** – Select **Recurring**.
    - **Start Date** – Enter the date you want to send the data to HubSpot.
    - **End** – Defaults to **Never**. If you want to end the HubSpot data sync on a specific date, set that here.
    - **Repeats** – Set to **Daily**.
    - **Repeat Every** – Set to **1 day**.
    - **Timing** – Enter the time you want to send the data to HubSpot.
    - **Time Zone** – Select the time zone in which you want to send this data.
14. For a one-time sync (one-time campaign), complete the following settings, then click **Apply**:
    - **Send Date** – Enter the date you want to send the data to HubSpot.
    - **Send Time** – Enter the time you want to send the data to HubSpot.
    - **Time Zone** – Select the time zone in which you want to send this data.
    - Click **Apply**.
15. Click **Save** and then click **Go Live**. Your sync starts at your designated start date and time.

## Connect HubSpot profiles to the ODP cookie

If you want to connect HubSpot contact IDs to ODP cookies when users click links in your emails, add the following parameter to URLs in your HubSpot emails: `&hubspot_id=contact.hs_object_id`

For example, if the link in your email is `https://www.mywebsite.com/home?utm_medium=email`, you would adjust it to `https://www.mywebsite.com/home?utm_medium=email&hubspot_id={{contact.hs_object_id}}`.

This lets you track website behavior like page views, source, medium, campaign, and more and enables more ODP real-time segment targeting opportunities with Optimizely Experimentation and CMS Visitor Groups.

## Troubleshoot the data sync

To ensure data is syncing as expected from ODP to HubSpot:

1. Go to **Settings > Event Inspector** in ODP.
2. Click **Start Inspector**. A number displays next to **Refresh** when data is available in the inspector.
3. Click **Refresh** to view the data. The raw data that ODP and HubSpot send back and forth displays.
4. Click **View Details** to see the formatted version of that raw data. Data fields sent from HubSpot  back to ODP start with `_hubspot`.

Each data sync is also logged in the [ODP activity log](docId\:iFvVHEUE8tk4PlyXWw4Ro):

1. Go to **Settings** > **Activity Log**.
2. Filter the categories by **hubspot**.
3. Click **View Details** for a formatted view of the log details, including the number of matches.
