# Calendly

The ReferralHero / Calendly Integration is very powerful and allows you to track and reward subscribers based on booked sales calls or demos.

1. Go to your Calendly account&#x20;
2. Go to My Calendly -> Event Types -> Edit Event

![](/files/z3sb7RFpOlFRfXZMklZx)

3\. Go to Additional Options -> Confirmation Page and change the following options:&#x20;

* *On Confirmation*:

  Select “Redirect to an external site”&#x20;
* *Redirect URL*:&#x20;

  Add the URL of a page that will act as a “Thank You Page” after the person submits the Calendry form (Note: you may have to create this page on your website so you can have a dedicated URL)&#x20;
* *Pass event details to your redirect page:*&#x20;

  Check the box

![](/files/67JeleA41AYo6eOHWGgN)

4\. Make sure you have added the ReferralHero Global Tracking script to the \<head> tag of your website.&#x20;

5\. Add one of the following scripts to \<head> tag specifically on the "Thank You Page" or page used for the Redirect URL above.&#x20;

Use **RH\_MFxxxxxxxxxx.form.submit()** to add both non-referrals and track referrals to the referral campaign. Replace `'MFxxxxxxxxxx'` with your specific campaign UUID.

```javascript
<script>
window.onload = (event) => {
  let params = new URLSearchParams(document.location.search);
  var data = {
      email: params.get("invitee_email"),
      name: params.get("invitee_full_name")
  };
  if (RH_MFxxxxxxxxxx) {
    RH_MFxxxxxxxxxx.form.submit(data);
  }
}
</script>
```

**If you have the ReferralHero "Terms and Conditions" feature enabled** (D*esign > Opt-in Form*) for your campaign. Use this script instead:

```javascript
<script>
window.onload = (event) => {
  let params = new URLSearchParams(document.location.search);
  var data = {
      email: params.get("invitee_email"),
      name: params.get("invitee_full_name"),
      terms: true
  };
  if (RH_MFxxxxxxxxxx) {
    RH_MFxxxxxxxxxx.form.submit(data);
  }
}
</script>
```

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

```javascript
<script>
window.onload = (event) => {
  let params = new URLSearchParams(document.location.search);
  var data = {
      email: params.get("invitee_email"),
      name: params.get("invitee_full_name")
  };
  if (RH) {
    RH.pendingReferral(data);
  }
}
</script>
```

{% hint style="info" %}
Note: This will pass the Full Name and Email of the invitee to your ReferralHero campaign and create a subscriber. If you want to pass additional data to ReferralHero you will have to add additional variables, see [Calendly documentation here](https://help.calendly.com/hc/en-us/articles/360040257613#information-you-can-send-in-the-redirect-url-0-0).
{% endhint %}

Now, every time a Calendly form is submitted, a subscriber (a referral or non-referral) will be added to ReferralHero.


---

# 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://support.referralhero.com/campaign-builder/integrations/calendly.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.
