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

# HubSpot

Sync GrowSurf participant data to HubSpot contacts and trigger referrals when deals reach a selected stage.

## Referral Trigger

### Description

When you connect your HubSpot account to your GrowSurf program and enable *Referral Trigger*, GrowSurf will automatically detect and trigger referrals on HubSpot deal stage changes.

GrowSurf checks whether any contact associated with the HubSpot deal has the same email address as a GrowSurf participant. If one does, GrowSurf triggers the referral, gives the referrer credit, and unlocks any rewards, if applicable.

Here's how to set up HubSpot referral triggers:

### **How to Set Up**

{% hint style="warning" %}
If your program does not add participants automatically ([see image](https://files.gitbook.com/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), add them first with JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or the REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant).
{% endhint %}

**Step 1**: In *Program Editor > 4. Options > Integrations*, click the *Connect to HubSpot* button.

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-MctyFeaRQFLG9flm6Jg%2F-McuA_iGt_GuBPhVbIgF%2FScreen%20Shot%202021-06-22%20at%203.47.07%20PM.png?alt=media\&token=35c39857-a222-4ece-a1be-6ca312bd715a)

**Step 2:** Once connected, toggle the switch to enable the *Referral Trigger*.

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-MctyFeaRQFLG9flm6Jg%2F-McuB89oeuTfSAufwNvj%2FScreen%20Shot%202021-06-22%20at%203.49.54%20PM.png?alt=media\&token=ee0b5b76-5a49-4ea7-acc7-3b567022f279)

**Step 3:** Select a HubSpot pipeline, then select a deal stage.

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-MctyFeaRQFLG9flm6Jg%2F-McuBTXIWOzbenfsmLeK%2FScreen%20Shot%202021-06-22%20at%203.51.16%20PM.png?alt=media\&token=9b88a6cd-58a5-45be-be5f-998f960a9ad5)

**(Optional) Step 4:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for making sure that deals that fall through do not count as referrals. During this hold period, if a deal does not retain the stage you selected, the referral trigger will be canceled completely.
{% endhint %}

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-MctyFeaRQFLG9flm6Jg%2F-McuBgItALd_HDNShn2s%2FScreen%20Shot%202021-06-22%20at%203.51.39%20PM.png?alt=media\&token=ed31a69b-0435-47da-b403-dcc032d73a84)

### Troubleshooting Tips

* When testing out the HubSpot Referral Trigger integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* HubSpot can take a minute or longer to send deal stage changes, so a referral may not trigger right away.

## Sync Data

### **Description**

When new GrowSurf participants are added to your program, they will automatically be added/updated as HubSpot contacts with a new property group *GrowSurf.* Their unique share link and referrer information will be available for use in emails and reports.

### How to Set Up

**Step 1:** In *Program Editor > 4. Options > Integrations*, click the *Connect to HubSpot* button

{% hint style="info" %}
Connect HubSpot before importing participants. If participants are already in your program, follow [these ESP sync options](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to send their GrowSurf data to HubSpot.
{% endhint %}

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LmOgBGPX3fe_Qtgw3-W%2F-LmOlCN4iy6AakjEDPHv%2FHubSpot%20-%20Connect%20in%20GrowSurf.png?alt=media\&token=a3dcab9e-a558-486d-9c44-4f4e6c8176e3)

**Step 2:** Choose a HubSpot account

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LmOgBGPX3fe_Qtgw3-W%2F-LmOlJ67NDlYYLe2Afn0%2FHubSpot%20-%20Choose%20Account.png?alt=media\&token=ea2530a7-65a8-4a5c-86b3-334ab8f2785b)

**Step 3:** Review the permissions GrowSurf is requesting, then click *Connect app*

GrowSurf requests five permissions. It reads and writes contacts so participants can be created and kept up to date, reads and writes contact property settings so it can create the *GrowSurf* property group, and reads deals so it can detect the deal stage that triggers referral credit.

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2Fgit-blob-10305d3f6d1c3b763e30fabcd4fb267e09e82e08%2FHubSpot%20-%20Scope%20Approval.png?alt=media)

Once you have successfully connected to HubSpot, GrowSurf will automatically create a new contact property group called *GrowSurf* in your HubSpot account that contains new contact properties (see image below). You can confirm these contact properties in the *Settings > Contact Properties* page in your Hubspot account.

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LmOgBGPX3fe_Qtgw3-W%2F-LmOlUsmlURIt_Kt6tBc%2FHubSpot%20-%20Contact%20Properties.png?alt=media\&token=7cbdcbdf-8a78-45d2-9a22-c7d66d84595d)

### Examples

[View our HubSpot tutorials](https://docs.growsurf.com/additional-integrations/hubspot/tutorial) to see different kinds of examples that you can copy/paste into your email templates.

### Contact Properties

GrowSurf will automatically create these new contact properties for your HubSpot contacts.

| **Contact properties**                   | **Field type**   | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                  |
| ---------------------------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| GrowSurf Share URL                       | Single-line text | text     | The participant's unique Share URL (contains their unique GrowSurf ID)                                                                                                                                    | `https://piedpiper.com?grsf=d77a8j`                          |
| GrowSurf Participant ID                  | Single-line text | text     | The participant's unique GrowSurf ID                                                                                                                                                                      | `d77a8j`                                                     |
| GrowSurf Referral Status                 | Single-line text | text     | The referral status of the participant\*                                                                                                                                                                  | `CREDIT_PENDING`                                             |
| GrowSurf Referrer Email                  | Single-line text | text     | The email of the participant's referrer                                                                                                                                                                   | `gavin@hooli.com`                                            |
| GrowSurf Referrer First Name             | Single-line text | text     | The first name of the participant's referrer                                                                                                                                                              | `Gavin`                                                      |
| GrowSurf Referrer Last Name              | Single-line text | text     | The last name of the participant's referrer                                                                                                                                                               | `Belson`                                                     |
| GrowSurf Participant First Name          | Single-line text | text     | The participant's First Name                                                                                                                                                                              | `Bob`                                                        |
| GrowSurf Participant Last Name           | Single-line text | text     | The participant's Last Name                                                                                                                                                                               | `Loblaw`                                                     |
| GrowSurf Total Referral Count            | Number           | number   | The participant's all-time referral count                                                                                                                                                                 | `0`                                                          |
| GrowSurf Lead Count                      | Number           | number   | The participant's current lead count (pending referrals that have not converted yet)                                                                                                                      | `0`                                                          |
| GrowSurf Monthly Referral Count          | Number           | number   | The participant's current month referral count                                                                                                                                                            | `19`                                                         |
| GrowSurf Previous Monthly Referral Count | Number           | number   | The participant's previous month referral count                                                                                                                                                           | `200`                                                        |
| GrowSurf Next Milestone                  | Single-line text | text     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Next Monthly Milestone          | Single-line text | text     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Total Invite Count              | Number           | number   | The participant's all-time invite count                                                                                                                                                                   | `112`                                                        |
| GrowSurf Total Impression Count          | Number           | number   | The participant's all-time impression count                                                                                                                                                               | `150`                                                        |

\**GrowSurf Referral Status* can have one of these values:

* `CREDIT_PENDING`: The participant must trigger a referral before their referrer receives credit.
* `CREDIT_AWARDED`: The participant triggered a referral, and their referrer received credit.
* `CREDIT_EXPIRED`: The participant did not trigger a referral before the referral credit expired.

\* HubSpot rate-limits API calls on every plan. [Learn more here](https://developers.hubspot.com/apps/api_guidelines).

[Learn more about Hubspot's property fields here.](https://knowledge.hubspot.com/contacts/property-field-types-in-hubspot)

### Troubleshooting Tips

* When the first participant sync runs, GrowSurf creates a **GrowSurf** contact property group in HubSpot. You can find it under **Settings > Data Management > Properties**.
* Check the participant's activity logs if they do not sync. GrowSurf retries failed syncs for up to 7 days.
* **If a Hubspot contact has multiple email addresses, GrowSurf will only sync participant data to one HubSpot contact:**
  * Each of your HubSpot contacts is uniquely identifiable by their primary email address. Similarly, all GrowSurf participants are uniquely identified by their email address. When GrowSurf adds a new primary contact or updates an existing primary contact within your Hubspot account, only the email address associated with the GrowSurf participant will be updated, reflecting their GrowSurf participant information.

## Disconnecting and Uninstalling

#### How to Disconnect HubSpot from GrowSurf

**Step 1:** Go to *Program Editor > 4. Options > Integrations* and open the HubSpot panel.

**Step 2:** Click *Disconnect* at the bottom of the panel.

GrowSurf immediately deletes the HubSpot access and refresh tokens it was storing for the program, and it asks HubSpot to remove the GrowSurf app from the connected account. You do not need to do anything in HubSpot afterwards.

#### How to Uninstall GrowSurf from Your HubSpot Account

You can also remove the app from the HubSpot side. In HubSpot, go to *Settings > Integrations > Connected Apps*, find GrowSurf, and uninstall it. HubSpot's own guide walks through the screens: [Connect apps to HubSpot](https://knowledge.hubspot.com/integrations/connect-apps-to-hubspot#uninstall-an-app).

Uninstalling in HubSpot revokes GrowSurf's access right away. The integration will still appear as connected in your Program Editor until you click *Disconnect* there as well, so it is worth doing both.

#### What Happens to Your Account and Your Data

**In HubSpot:**

* GrowSurf stops adding and updating contacts, and stops reading deals.
* The **GrowSurf** contact property group and every property in it stay in your account. Nothing is deleted or overwritten.
* The values already written to your contacts, such as share URLs, referrer names, and referral counts, stay on those contacts and remain available in your lists, emails, and reports.
* If you want the properties gone, delete them yourself under *Settings > Data Management > Properties*. Deleting a property also deletes its values on every contact, and that cannot be undone.

**In GrowSurf:**

* Referral Trigger stops. Deal stage changes in HubSpot no longer trigger referrals, and any referral still inside its hold period will not complete through HubSpot.
* Your participants, referrals, and rewards are untouched. Disconnecting an integration never removes program data.
* Nothing is queued up for later. Reconnecting starts syncing from that point forward, so participants added while you were disconnected are not backfilled. [Here are your options](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) if you need to sync them afterwards.

{% hint style="warning" %}
If you have more than one GrowSurf program connected to the same HubSpot account, uninstalling the app removes it for that whole HubSpot account, not just the one program. Your other programs will need to reconnect.
{% endhint %}


---

# 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://docs.growsurf.com/integrations/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.
