> For the complete documentation index, see [llms.txt](https://docs.anedot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anedot.com/integrations/crm-donor-management/hubspot.md).

# HubSpot

Connect Anedot to HubSpot to sync contact and donation data, configure Deal properties, map hidden fields, and manage supporter records in your CRM.

> For the complete documentation index, see [llms.txt](https://anedot.gitbook.io/anedot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anedot.gitbook.io/anedot-docs/integrations/crm-donor-management/hubspot.md).

## HubSpot

Connect Anedot to HubSpot to automatically send contact and donation data, configure custom Deal properties, map hidden fields, and manage supporter records directly within your CRM.

HubSpot is a CRM platform offering tools for supporter management, marketing, sales, and content. Anedot integrates with HubSpot to relay Contact and Deal data from Submissions and Donation Events collected through Action Pages.

### Connecting Anedot to HubSpot

Follow these steps to connect your Anedot fundraising account to HubSpot:

1. In your Anedot account, go to **Settings → Integrations → Directory**.
2. Click **+ New Connection** in the top-right corner.
3. Select **HubSpot** from the list.
4. Choose the Action Pages to sync (default is all). To exclude pages, list their Action Page IDs (comma-separated).
5. (Optional) Limit the sync to a specific Team.
6. (Optional) If you are only sending Contact data, skip the next step. You are redirected to log in to HubSpot and select the account you want to connect. If the connection is successful, you return to the Integration Directory in Anedot. If it fails, an error page appears—contact Support and include a screenshot of the error message.
7. To include Donation Events as Deals, enter your HubSpot Pipeline ID and Deal Stage ID:
   1. Go to **Sales → Deals → Edit Pipelines** in HubSpot.
   2. Select a Pipeline from the **Select a pipeline** list.
   3. Use the `</>` icon to copy the IDs for your desired Pipeline and Stage.
8. (Optional) Set up Custom Deal Properties in HubSpot (see below). Suggested properties:
   * Action Page Name (single-line text)
   * Communications Consent Email (single checkbox)
   * Communications Consent Phone (single checkbox)
   * Transaction ID (single-line text)
   * Recurring (single checkbox)
   * Source Code (single-line text)
   * UTM Campaign (single-line text)
   * UTM Content (single-line text)
   * UTM Medium (single-line text)
   * UTM Source (single-line text)
   * UTM Term (single-line text)
9. Click **Save**.
10. You are redirected to log in to HubSpot and select your account. If the connection succeeds, you return to Anedot. If it fails, contact Anedot Support and include a screenshot of the error.

Once connected, you can update Action Pages and Team settings anytime.

To change credentials, you must create a new HubSpot connection.

{% hint style="warning" %}
Avoid multiple HubSpot connections for the same Deal data—this can cause duplicate Deals in HubSpot.
{% endhint %}

### Set Up Custom Deal Properties in HubSpot

To relay extra data (such as UTM parameters or recurring status), create custom properties:

1. Go to **Settings → Properties** in HubSpot.
2. Under **Select an Object**, choose **Deal properties**.
3. Click **Create Property**, then:
   * Set **Object type** to Deal
   * Set **Group** to Deal Information
   * Add your **Label** and choose the appropriate **Field Type** (see table below)
   * If the **checkbox** field type is selected, leave the default values
   * Click **Next**
4. (Optional) Select **Property Rules**.
5. Click **Create**.
6. Copy the **Internal ID** of each property for use in Anedot:
   1. Navigate to Deal Properties.
   2. Click **Edit** and click the `</>` icon to copy the Internal ID.
   3. Paste the ID into the corresponding Anedot field in the HubSpot connection drawer (**Settings → Integrations → Directory**).

#### Field Type

| Anedot Field                 | HubSpot property type |
| ---------------------------- | --------------------- |
| Action Page Name             | single-line text      |
| Communications Consent Email | single checkbox       |
| Communications Consent Phone | single checkbox       |
| Recurring                    | single checkbox       |
| Source Code                  | single-line text      |
| UTM Campaign                 | single-line text      |
| UTM Content                  | single-line text      |
| UTM Medium                   | single-line text      |
| UTM Source                   | single-line text      |
| UTM Term                     | single-line text      |

### Set Up Custom Hidden Fields

To relay Custom Hidden Field data from Anedot to HubSpot, create a corresponding Custom Property in HubSpot and then link it to Anedot.

#### Step 1: Create a Custom Property in HubSpot

1. In HubSpot, go to **Settings → Data Management → Properties**.
2. From the Object dropdown, select **Deal properties**.
3. Click **Create Property**.
4. Fill in the following:
   * Property Label (your internal field name)
   * Object Type: Deal
   * Group: Deal Information
   * Field Type: Single-line text
5. Click **Create** in the top-right corner.
6. After creation, copy the field's Internal ID by clicking the `</>` icon—this is used in Anedot.

#### Step 2: Create a Custom Hidden Field in Anedot

1. In Anedot, go to the Action Page Builder → **Form** tab.
2. Add a Custom Field and set the Field Type to **Hidden**.
3. Name the field using the format: `hubspot_{internal_id}`
   * Example: `hubspot_account_id`
4. Assign the value to be passed using one of the following methods:
   * **Global Value** — applies the same value to all pages using the field.
   * **Page Specific Value** — leave Global Value blank, then go to **Settings → Sharing → Page Specific Values**.
   * **URL Parameter** — leave both Global and Page-Specific values blank to pass dynamic values via URL.
5. Click **Save** to store the Hidden Custom Field.
6. Click **Publish** to apply your changes to the page.

### Data Relays and Behavior

* Anedot sends relays for both Donation and Lead Pages.
* Custom Hidden Fields are supported; non-hidden custom fields are not.
* If no Deal Stage is set, only basic contact info is relayed: First Name, Last Name, Phone, Address, City, State, Zip.
* If a donor record does not exist in HubSpot, a new contact is created. Otherwise, the existing record is updated with any new data.

### Field Mapping

#### Contact Relays

HubSpot Contact Relays are sent as grouped properties with a value. For example: `{"value": "Annie", "property": "firstname"}`

| Anedot Field            | HubSpot Property |
| ----------------------- | ---------------- |
| firstName               | firstname        |
| lastName                | lastname         |
| phone                   | phone            |
| address `{line1}`       | address          |
| address `{city}`        | city             |
| address `{region}`      | state            |
| address `{postal_code}` | zip              |

#### Deal Relays

| Anedot Field                                       | HubSpot Property                                |
| -------------------------------------------------- | ----------------------------------------------- |
| totalAmount (×100)                                 | amount                                          |
| `"firstName lastName - (totalAmount x 100)"`       | dealname                                        |
| `"default"`                                        | pipeline                                        |
| \*\*utmCodes `{term}`                              | utm\_term                                       |
| created\_at (timestamp on submission)              | closedate                                       |
| dealstage (HubSpot Property)                       | dealstage                                       |
| `"true"` or `"false"`                              | recurring                                       |
| \*\*utmCodes `{medium}`                            | utm\_medium                                     |
| \*\*utmCodes `{source}`                            | utm\_source                                     |
| sourceCode                                         | source\_code                                    |
| \*\*utmCodes `{content}`                           | utm\_content                                    |
| \*\*utmCodes `{campaign}`                          | utm\_campaign                                   |
| actionPage `{name}`                                | action\_page\_name                              |
| communicationsConsentEmail (`"true"` or `"false"`) | communications\_consent\_email                  |
| communicationsConsentPhone (`"true"` or `"false"`) | communications\_consent\_phone                  |
| vid (from Contact Relay Response Body)             | associations\_to\_id                            |
| `"HUBSPOT_DEFINED"`; `"3"`                         | types `{associationTypeId associationCategory}` |

\*\* UTM fields can be added to the Page URL.

### Payload Data for Contact Relays

All Lead Page submissions are sent to HubSpot as Contact relays. Donation Page submissions are also sent as Contact relays—but only if Deals are not configured.

If a donor does not already exist in HubSpot, a new contact record is created. If the contact exists, HubSpot updates the record with any new or different information included in the relay.

#### Request Body

```json
{
  "properties": [{
    "value": "Annie",
    "property": "firstname"
  }, {
    "value": "Dot",
    "property": "lastname"
  }, {
    "value": "8888882343",
    "property": "phone"
  }, {
    "value": "777 Anedot Way",
    "property": "address"
  }, {
    "value": "Anedot",
    "property": "city"
  }, {
    "value": "LA",
    "property": "state"
  }, {
    "value": 70112,
    "property": "zip"
  }]
}
```

#### Response Body

```json
{
  "vid": 101,
  "is_new": false
}
```

### Payload Data for Deal Relays

#### Request Body (without Custom Deal Properties)

```json
{
  "properties": {
    "amount": "50.00",
    "dealname": "Annie Dot - 50.00",
    "pipeline": "default",
    "closedate": "2023-03-30T15:07:19Z",
    "dealstage": "66041629"
  },
  "associations": [{
    "to": {
      "id": "2551"
    },
    "types": [{
      "associationTypeId": 3,
      "associationCategory": "HUBSPOT_DEFINED"
    }]
  }]
}
```

#### Request Body (with Custom Deal Properties)

```json
{
  "properties": {
    "amount": "50.00",
    "dealname": "Annie Dot - 50.00",
    "pipeline": "",
    "utm_term": null,
    "closedate": "2023-05-09T19:44:21Z",
    "dealstage": "66041629",
    "recurring": true,
    "utm_medium": null,
    "utm_source": null,
    "source_code": "1234555",
    "utm_content": null,
    "utm_campaign": null,
    "action_page_name": "Page 8",
    "communications_consent_email": true,
    "communications_consent_phone": true
  },
  "associations": [{
    "to": {
      "id": "5651"
    },
    "types": [{
      "associationTypeId": 3,
      "associationCategory": "HUBSPOT_DEFINED"
    }]
  }]
}
```

#### Response Body

```json
{
  "id": "12777199902",
  "archived": false,
  "created_at": "2023-03-30T15:07:20.732Z",
  "properties": {
    "amount": "50.00",
    "dealname": "Annie Dot - 50.00",
    "pipeline": "default",
    "closedate": "2023-03-30T15:07:19Z",
    "dealstage": "66041629",
    "createdate": "2023-03-30T15:07:20.732Z",
    "hs_is_closed": "false",
    "hs_object_id": "12777199902",
    "days_to_close": "0",
    "hs_createdate": "2023-03-30T15:07:20.732Z",
    "hs_closed_amount": "0",
    "hs_is_closed_won": "false",
    "hs_is_deal_split": "false",
    "hs_forecast_amount": "50.00",
    "hs_lastmodifieddate": "2023-03-30T15:07:20.732Z",
    "hs_projected_amount": "0",
    "amount_in_home_currency": "50.00",
    "hs_deal_stage_probability_shadow": "0.100",
    "hs_closed_amount_in_home_currency": "0",
    "hs_projected_amount_in_home_currency": "0"
  },
  "updated_at": "2023-03-30T15:07:20.732Z"
}
```

#### Response Status (Success)

```
201
```

***

## 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://anedot.gitbook.io/anedot-docs/integrations/crm-donor-management/hubspot.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.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.anedot.com/integrations/crm-donor-management/hubspot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
