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

# HubSpot

{% hint style="info" %}
**Note:** The Hubspot integration is only available to users on a LoyaltySurf paid plan.
{% endhint %}

### Description

A use-case for this would be if you want to automatically send out gift cards to leads who who complete a demo call with your sales team. This would be triggered after your sales team updates their HubSpot deal stage.

LoyaltySurf will check if the HubSpot deal's associated contacts' email addresses match a LoyaltySurf participant's email address. If a match is found, then a loyalty action will trigger, giving loyalty action credit to the participant and unlocking any rewards, if applicable.

Here's how to set up the HubSpot integration:

### **How to Set Up**

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

<figure><img src="/files/2lUpPgxcQOMW66aaX2Zm" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, toggle the switch to enable the *Loyalty Action Trigger,* then press the 'Connect A Reward' button to link your reward.

<figure><img src="/files/Yr7NhZb0812C2yfjWs2S" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/WDQO5GauFPSrAaG3JsdC" alt=""><figcaption></figcaption></figure>

**(Optional) Step 4:** Add a loyalty action trigger hold period by toggling the *Show advanced settings* section.

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

### Troubleshooting Tips

* When testing out the HubSpot integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* Events from HubSpot, such as changes in a deal stage, are sent to LoyaltySurf asynchronously and may take up to a minute or longer to process, depending on the system load. As a result, LoyaltySurf can only trigger the corresponding loyalty action once it has received the event. To manage this process, we use a message queue. Therefore, please be patient if you do not see a loyalty action trigger immediately.


---

# 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.loyaltysurf.io/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.
