# GoHighLevel

The ReferralHero / GoHighLevel integration is a robust solution offering several powerful functionalities:

* Import existing contacts from GoHighLevel to ReferralHero
* Automatically add new GoHighLevel contacts to ReferralHero
* Sync ReferralHero subscribers to your GoHighLevel account
* Use your own GoHighLevel form to add new contacts to your ReferralHero campaign
* Trigger a ReferralHero conversion event when an Opportunity Status or Stage changes in GoHighLevel

### Import GoHighLevel Contacts into ReferralHero

If you have existing contacts in GoHighLevel and want to import them into your ReferralHero campaign, follow these steps:

1. Go to your *Campaign Dashboard → Edit Campaign → Add Subscribers → Import via Integration.*
2. If your GoHighLevel account is not connected yet, go to the Integrations section and complete the connection.
3. Once connected, the **Import from GoHighLevel** block will appear. Click Import to import your contacts.
4. Imported subscribers will automatically receive the Welcome Email/SMS if it is enabled in your campaign.

{% hint style="success" %}
**NOTE:** The import starts immediately. Depending on the number of subscribers, it may take from a few minutes to several hours. You will receive an email when the import is complete.
{% endhint %}

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fvf9BDaQr81px9po4zT2r%2Fimage.png?alt=media&#x26;token=526e4085-7106-4647-a214-2154c8c82b75" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
**IMPORTANT:** If you turn on the GoHighLevel integration (see the section below), ReferralHero will populate the custom fields in your GoHighLevel account with the subscriber's values.
{% endhint %}

### Automatically Add New GoHighLevel Contacts to ReferralHero <a href="#add-new-hubspot-contacts-to-referralhero" id="add-new-hubspot-contacts-to-referralhero"></a>

#### Step 1: Install GoHighLevel Tracking Code

To ensure accurate tracking of contacts, install the GoHighLevel tracking code on your website:

1. Log in to your GoHighLevel account.
2. Go to *Settings → External Tracking → External Tracking Script Installation.*
3. Copy the tracking script and embed it on your website.

#### Step 2: Configure Contact Creation Tracking

ReferralHero’s **GoHighLevel Contact Created** event automatically identifies whether new contacts are non-referrals or referrals, and adds them to your ReferralHero campaign.

1. In ReferralHero, navigate to *Edit Campaign → Integrations → GoHighLevel.*
2. Click **Connect your GoHighLevel account**.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fs0mmj7WG8OTNNKmjEDra%2Fimage.png?alt=media&#x26;token=e36661c9-e172-4519-8b62-4485f792ea03" alt=""><figcaption></figcaption></figure>

3. Choose the GoHighLevel account you want to connect.
4. Toggle on **Enable GoHighLevel Integration**.
5. In the **GoHighLevel Events** section, click **Add Event to Track**.
6. Select **Create Contact** as the **GoHighLevel Event Type**.
7. Give the event a name.
8. In **Trigger Event Type**, choose whether to:
   * **Add All (Non-Referrals and Referrals)**
   * **Add Referrals Only**
9. Click **Start Tracking**.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FwWBRx5vnHuJ6uwkTG6Nq%2Fimage.png?alt=media&#x26;token=5b2cfd76-d928-49a2-9f77-fa8ede916cf8" alt="" width="563"><figcaption></figcaption></figure>

#### Automatically Created Custom Fields in GoHighLevel

When the integration is enabled, the following custom fields will be created in your GoHighLevel account:

| **SUB\_ID**         | Subscriber's id                        |
| ------------------- | -------------------------------------- |
| **EX\_FIELD**       | Subscriber's extra field value         |
| **EX\_FIELD\_2**    | Subscriber's second extra field value  |
| **OPTION\_FIELD**   | Subscriber's option field value        |
| **CODE**            | Subscriber's unique referral code      |
| **FB\_LINK**        | Subscriber’s Facebook link             |
| **TW\_LINK**        | Subscriber’s Twitter link              |
| **EM\_LINK**        | Subscriber’s email link                |
| **REF\_LINK**       | Subscriber's unique referral link      |
| **TOT\_REF**        | Subscriber's total number of referrals |
| **LAST\_REF**       | Timestamp of last referral             |
| **MWR**             | Subscriber’s referrer’s referral code  |
| **POSITION**        | Subscriber’s position                  |
| **POINTS**          | Subscriber’s total accumulated points  |
| **REFERRER**        | Subscriber’s referrer’s name           |
| **REFERRER\_EMAIL** | Subscriber’s referrer’s email          |

Now when a person signs up for your ReferralHero campaign, they will be immediately added to your GoHighLevel account.

{% hint style="success" %}
**NOTE**: ReferralHero will automatically update these custom fields when a person signs up or when things change (eg: when a subscriber refers a new person, their TOT\_REF value changes).
{% endhint %}

### How to Use Your Own GoHighLevel Signup Form <a href="#how-to-use-your-own-hubspot-signup-form" id="how-to-use-your-own-hubspot-signup-form"></a>

While the **Contact Created** event is recommended, high-volume forms (100+ new contacts/day) can be tracked using a redirect URL and ReferralHero JavaScript on a thank-you page.

#### Step 1: Create a Custom Thank-You Page

1. Create a thank-you page on your website.
2. Add one of the following ReferralHero JavaScript codes to your thank-you page.

**Option 1:** Use **RH.form.submit()** to add both non-referrals and track referrals to the referral campaign

```
<script>
(function () {
 function getQueryParam(param) {
   return new URLSearchParams(window.location.search).get(param);
 }

 const email = getQueryParam("email");
 const firstName = getQueryParam("firstName") || "";
 const lastName = getQueryParam("lastName") || "";
 const phone = getQueryParam("phone") || "";

 const referralHeroData = {
   email: email,
   phone_number: phone,
   name: `${firstName} ${lastName}`.trim()
 };

 function sendReferralData() {
   if (typeof window.RH_MF5f3db1d68d !== "undefined" && email) {
     window.RH_MF5f3db1d68d.form.submit(referralHeroData);
     console.log("ReferralHero data submitted successfully.");
   } else {
     console.log("ReferralHero not loaded or email missing.");
   }
 }

 const checkRHLoaded = setInterval(function () {
   if (typeof window.RH_MF5f3db1d68d !== "undefined") {
     clearInterval(checkRHLoaded);
     sendReferralData();
   }
 }, 300);
})();
</script>

```

**Option 2:** Use **RH.pendingReferral()** to track only referrals with ‘Pending’ status to the multi-step conversion event campaign

```
<script>
(function () {
 function getQueryParam(param) {
   return new URLSearchParams(window.location.search).get(param);
 }

 const email = getQueryParam("email");
 const firstName = getQueryParam("firstName") || "";
 const lastName = getQueryParam("lastName") || "";
 const phone = getQueryParam("phone") || "";

 const referralHeroData = {
   email: email,
   phone_number: phone,
   name: `${firstName} ${lastName}`.trim()
 };

 function sendReferralData() {
   if (typeof window.RH !== "undefined" && typeof window.RH.pendingReferral === "function" && email) {
     window.RH.pendingReferral(referralHeroData);
     console.log("ReferralHero data submitted successfully.");
   } else {
     console.log("ReferralHero not loaded or email missing.");
   }
 }

 const checkRHLoaded = setInterval(function () {
   if (typeof window.RH !== "undefined" && typeof window.RH.pendingReferral === "function") {
     clearInterval(checkRHLoaded);
     sendReferralData();
   }
 }, 300);
})();
</script>

```

#### Step 2: Configure Your GoHighLevel Form

1. Go to your *GoHighLevel Form → Settings.*
2. Select **Redirect to URL** from the **On Submit** dropdown.
3. Enter your custom thank-you page URL with parameters:

[https://mywebsite/thankyoupage?email={{contact.email}}\&firstName={{contact.first\_name}}\&lastName={{contact.last\_name}}\&phone={{contact.phone}} <br>](https://mywebsite/thankyoupage?email={{contact.email}}\&firstName={{contact.first_name}}\&lastName={{contact.last_name}}\&phone={{contact.phone}})

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fiv2WT7RsMPcVsQvXVDSg%2Fimage.png?alt=media&#x26;token=30d03995-bf1d-445e-b41c-eda5dfc53808" alt=""><figcaption></figcaption></figure>

4. Save the form

New form submissions will now be added to both your GoHighLevel contact list and ReferralHero campaign.

### Track a GoHighLevel Conversion Event

You can trigger actions in ReferralHero when GoHighLevel contacts undergo an **Opportunity Status** or **Opportunity Stage** change.

1. Go to the **GoHighLevel Integration** page in ReferralHero.
2. Click **Add Event To Track**.
3. Enter a name for the event.
4. Select the GoHighLevel event type to track (e.g., Opportunity Status or Opportunity Stage ).
5. Choose the specific status or stage that triggers the event.
6. Select the **Trigger Event Type** based on the action you want ReferralHero to perform.

**Available ReferralHero Actions:**

* Add All (Non-Referrals and Referrals)
* Add Referrals Only
* Update Total Spend&#x20;
* Change Referral Status (most common use case)

**Change Referral Status to Unqualified**

* The **Change Referral Status** event allows updates from any current referral status to **Unqualified** (one-way updates)
* When **Unqualified** is selected in the “Referral status changes to” dropdown, the “Referral status changes from” dropdown is removed
* Referrals are automatically moved to **Unqualified** when the trigger condition is met, regardless of their current status
* Unqualified is a non-linear status and does not follow the standard conversion flow

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FGGcX8zJs5Zyz9ZSYhY9N%2Fimage.png?alt=media&#x26;token=df6a09c0-a4a4-4ee7-9eef-cac495df7ed6" alt="" width="478"><figcaption></figcaption></figure>
