# 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="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FVHwKfoPLh255c9yNa03h%2FScreen%20Shot%202023-01-13%20at%2012.05.05%20AM(1).png?alt=media&#x26;token=fed16021-d816-46e1-a7ef-9f30ee2c35c4" 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="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2F1eyQh0Nmbk4bW0MzWxQ9%2FScreen%20Shot%202023-01-13%20at%203.03.36%20PM.png?alt=media&#x26;token=4552f081-3612-4a63-8588-64f52156a875" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2Fdi1D0JbJbMjdHIHAFYtK%2FScreen%20Shot%202023-01-13%20at%203.07.49%20PM.png?alt=media&#x26;token=f95e824e-2c16-4e34-ac10-15bdafca85c7" 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: 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:

```
GET https://docs.loyaltysurf.io/integrations/hubspot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
