# HubSpot (Event Stream)

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

[HubSpot](https://www.hubspot.com/) is a CRM platform that helps scaling companies sell, market, and provide customer service from a unified UI. Amplitude's HubSpot streaming integration lets you forward your Amplitude events and event properties to HubSpot in a few clicks.

## Use cases

1. **Personalized marketing:** Track user behavior and capture user and event properties in Amplitude to create personalized, targeted marketing campaigns in HubSpot. This drives engagement, conversions, and customer loyalty.
2. **Lead scoring and nurturing:** Track user behavior and capture user and event properties in Amplitude to score and rank leads by engagement and interest. Use this to optimize lead nurturing and close more deals.
3. **Customer retention:** Track user behavior in Amplitude to identify customers at risk of churning and take proactive steps to retain them. For example, trigger personalized emails or ads with discounts or incentives to keep customers engaged.

## Considerations

Note the following when you send events to HubSpot:

- **Don't manually create or delete events or property definitions in HubSpot for your Amplitude events.** Amplitude automatically creates the necessary event and property definitions when you enable the integration. Amplitude expects event and property definitions in HubSpot to use Amplitude's internal naming and typing so the integration can match them consistently. If you manually create event or property definitions in HubSpot that don't match the Amplitude integration, you can't send events without additional steps because HubSpot can't change or permanently delete event definition names. It's safe to edit display names and descriptions in HubSpot. For more information, refer to [Troubleshooting](#troubleshooting).
- If you have an existing HubSpot streaming connection, re-authenticate with HubSpot to grant additional permissions to create events and properties. With this update, Amplitude sends events and their properties to different event definitions in HubSpot, matching each selected event, rather than to a single event definition from the internal event name.
- You must enable this integration in each Amplitude project you want to use it in.
- Events from Amplitude appear as custom events in HubSpot.
- Sending custom events requires a HubSpot Enterprise subscription. Refer to the [HubSpot Product & Services Catalog](https://legal.hubspot.com/hubspot-product-and-services-catalog) for more information.
- HubSpot events have these limits:

  - HubSpot enforces strict API rate limits. For more information, refer to HubSpot's [Usage Details](https://developers.HubSpot.com/docs/api/usage-details) page.
  - HubSpot limits event streaming to 30 million events per month. This is a HubSpot-enforced limitation.
  - HubSpot allows up to 50 custom properties for each custom event.
  - Amplitude truncates event and property names to 50 characters to comply with HubSpot's API limitations.
- Amplitude sends selected event and user properties along with the event.
- Amplitude targets an end-to-end p95 latency of 60 seconds. 95% of events stream to HubSpot within 60 seconds or less. Amplitude has internal processes, monitors, and alerts in place to meet this target.

## Set up the integration

### Amplitude setup

1. In Amplitude Data, navigate to _Catalog > Destinations_.
2. Scroll down and click _HubSpot_.
3. Enter a sync name, then click _Create Sync_.
4. Choose a HubSpot Account ID or authenticate with HubSpot. If you have an existing Account ID, re-authenticate to grant the necessary permissions from HubSpot.
5. Toggle the _Send events_ filter to select the events to send.
6. Under _Select & filter events_, choose the Amplitude events to map to HubSpot. Provide a HubSpot Internal Event Name that corresponds to the Amplitude event you selected. HubSpot recommends choosing the events that are most important to your use case.
7. Under _Map properties to destinations_, select the Event Properties to send. The HubSpot identifier for this object must be at least one of the following: `User Token`, `Email`, or `Object ID`.
8. Under _Select additional properties_, select any extra event and user properties to send to HubSpot. If you don't select any properties here, Amplitude doesn't send any.
9. When finished, enable the destination and click _Save_.
10. Click _Create in HubSpot_ if events or properties are missing.

    - If no event or property is missing in HubSpot, the creation modal doesn't appear.
    - If errors appear on this step, check the Troubleshooting section for next steps.
11. Click _Continue_, verify your connection, and click _Finish_.

### Troubleshooting

If you encounter an error when you try to create event or property definitions in HubSpot, or if you manually created and then deleted a custom event matched with an Amplitude event in HubSpot, try this workaround. It creates a custom event that references the original event and uses the new event instead. This doesn't impact existing charts that use the original event in Amplitude.

1. In Amplitude Data, navigate to _Events > Custom Events_.
2. Click _Create custom event_.
3. Name the custom event similar to the original, but not the same (for example, if you deleted `user_signup`, use `user_signup_copy`). This lets Amplitude create the event in HubSpot without naming conflicts.
4. Configure the custom event to be defined on the original event.
5. Update your HubSpot event stream to send this new custom event instead of the original (using the previous example, send `user_signup_copy` instead of `user_signup`), and complete the setup flow.
6. After Amplitude creates the event, use it in HubSpot workflows, reports, and automations in place of the original event.

## Use custom event data in HubSpot

Refer to the HubSpot documentation to learn more about how to [analyze custom events](https://knowledge.HubSpot.com/analytics-tools/analyze-custom-behavioral-events) in HubSpot.

### Report on custom events

Analyze custom event completions from the custom events tool. Event data is available in the custom report builder and attribution reports.

Learn more about [analyzing your custom events](https://knowledge.hubspot.com/analytics-tools/analyze-custom-behavioral-events).

### View event completions on the contact timeline

Event completions appear on the contact record timeline, along with any properties that populate.

To view event details on the contact timeline:

- [Navigate to a contact record](https://knowledge.hubspot.com/records/work-with-records) that has completed a custom event.
- To filter a contact timeline by completed events, click _Filter activity_, then select _Custom event_.
- In the contact timeline, click to expand the _event_ to display the event details.

### Use custom events in workflows

In a workflow, you can delay based on custom event completions using a [Delay until event happens action](https://knowledge.hubspot.com/workflows/use-delays) or an event enrollment trigger.

1. In your HubSpot account, navigate to _Automation > Workflows_.
2. Click the name of a workflow or learn how to create a new workflow.
3. In the workflow editor, click the + icon to add a workflow action.
4. In the right panel, click _Delay until the event happens_.
5. Configure the delay:

   - From the _Event_ dropdown menu, select a _custom event_.
   - Select the event property you want to delay on.
   - Select the filter for the event property.
   - Click _Apply filter_.
   - Select the maximum wait time, or check _Delay as long as possible_.
6. Click _Save_.

## Disconnect HubSpot from within Amplitude

To disconnect HubSpot from within Amplitude, follow these steps:

1. In Amplitude, navigate to _Data > Sources > HubSpot_.
2. Click the trash can icon.
3. Follow the instructions in the confirmation modal that appears.
4. Click _Delete_.

After you disconnect HubSpot, Amplitude doesn't process new data sent from this source. Amplitude doesn't delete historical data from HubSpot, so you can still analyze it.

## Uninstall Amplitude from a HubSpot account

To uninstall Amplitude from your HubSpot account, follow these steps:

1. In HubSpot, navigate to _Reporting & Data > Integrations > Connected apps > Amplitude_.
2. Select _Uninstall_ from the _Actions_ dropdown.
3. Follow the instructions in the confirmation modal that appears.
4. Click _Uninstall_.

This doesn't delete any existing Amplitude data in HubSpot, but Amplitude no longer updates it.
