> For the complete documentation index, see [llms.txt](https://help.distro.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.distro.so/routing-forms/hubspot-form.md).

# HubSpot forms

Distro supports both legacy embedded HubSpot forms and forms built with HubSpot's updated editor (V4). It starts routing after HubSpot reports a successful submission.

## Prepare and connect the form

1. Use an inline thank-you message so the visitor stays on the page for scheduling.
2. Copy the form ID from HubSpot's embed configuration.
3. In **Form routing → Forms**, create or edit the mapping. Use the HubSpot form ID for **Form selector** and map the field names needed by your rules.
4. Select the mapping under the router's **Form Submission → Connected form**, then configure, test, and activate the router.

For V4 contact fields, map the normalized name: `0-1/email` becomes `email`. Repeated checkbox values remain arrays. The visible field label can differ from its internal name.

## Install

Open **Install Router**, select **After a form → popup** and **HubSpot (legacy + V4)**, then copy the website snippet.

Initialize Distro **before the HubSpot form embed** so it can capture the V4 ready event. Replace the placeholders below with your router ID and HubSpot form ID. Use the form ID without a CSS `#` prefix.

```html
<script src="https://app.distro.so/inbound.js"></script>
<script>
  window.distro = new Distro({
    routerId: "YOUR_ROUTER_ID",
    formType: "hubspot"
  });
  distro.schedule("YOUR_HUBSPOT_FORM_ID");
</script>

<!-- Place the HubSpot form embed after the Distro initialization. -->
```

Existing legacy installations remain supported. Distro handles legacy `hsFormCallback` events as well as V4 ready and submission-success events, preserves captured values if HubSpot clears the form, and suppresses duplicate conversion callbacks. See HubSpot's [global form events](https://developers.hubspot.com/docs/api-reference/latest/marketing/forms/global-form-events).

## Verify

Test the published page with qualified and unqualified answers. Confirm the submission reaches HubSpot and the expected field values appear in Distro's **Routing Logs**.

If the page redirects before scheduling opens, change the HubSpot post-submission setting. If Distro does not connect, check the form ID, the order of the scripts, and whether the library loaded. Avoid installing multiple copies of the snippet for the same form.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.distro.so/routing-forms/hubspot-form.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
