# 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

![](https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FGM7HQuPzeWHGKIFTIjhs%2FScreen%20Shot%202022-07-11%20at%207.22.17%20PM.png?alt=media\&token=fd5ba09e-94c7-4ec4-be44-cc801d326b40)

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

![](https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FXU5iUxTlaqz8UKNYWidm%2FScreen%20Shot%202022-07-11%20at%207.23.47%20PM.png?alt=media\&token=23135a07-4f75-4337-9805-7f1ed3922d1b)

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 organic 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 (an organic or referral) will be added to ReferralHero.
