# Webflow

## Adding the ReferralHero Tracking Code <a href="#adding-the-referralhero-tracking-code" id="adding-the-referralhero-tracking-code"></a>

**Step 1:** Log into your Webflow account, select your project, and navigate to the **Settings** page.

**Step 2:** In the **Settings** menu, go to **Custom Code**.

**Step 3:** Go to your ***Campaign** > **Edit Campaign** > **Launch** instructions* and copy your **Global** **Tracking Code**

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FDyoqyWWPlzErPGRYKCLv%2Fimage1.webp?alt=media&#x26;token=e04b72b8-b4c9-424b-954c-d833ff791b43" alt=""><figcaption></figcaption></figure>

**Step 4:** Paste the **ReferralHero Tracking Code** into the **Head Code** text area, then save your changes.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FE8WhFYDJVNJQhsQpSx8Q%2Fimage2.webp?alt=media&#x26;token=8d05d87b-9e44-410e-b500-db40ad64bad6" alt=""><figcaption></figcaption></figure>

## Embedding the ReferralHero Widget <a href="#embedding-the-referralhero-widget" id="embedding-the-referralhero-widget"></a>

**Step 1:** After adding the tracking code, Go to the Webflow dashboard, select your project, and enter **Designer Mode**.

**Step 2:** Navigate to the page where you want to install ReferralHero.

**Step 3:** Add an **Embed** element by clicking the **+** icon and selecting **Code Embed**.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FQtv5XPnBn6wfqN5RJFqz%2Fimage3.png?alt=media&#x26;token=65e4000b-cd3e-4960-9c33-aa56328cf6bd" alt="" width="253"><figcaption></figcaption></figure>

**Step 4:** Drag the Embed element to the exact spot where you want the widget to appear.

**Step 5:** In the Embed code editor, paste `<div id='referralhero-dashboard-MFxxxxxxxxxx'>/div>`

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fol5XvRag8Df3U8LRlK95%2Fimage4.png?alt=media&#x26;token=5324b4a4-237d-4992-a706-4e9ca790641d" alt=""><figcaption></figcaption></figure>

**Step 6:** Save your changes and publish the website. The embedded widget should now appear on your selected page.

## Adding ReferralHero Custom Tracking to Webflow Forms <a href="#adding-referralhero-custom-tracking-to-webflow-forms" id="adding-referralhero-custom-tracking-to-webflow-forms"></a>

**Step 1:** After adding the ReferralHero tracking code, go to the Webflow dashboard, select your project, and enter **Designer Mode**.

**Step 2:** Navigate to the page containing the form where you want to apply the ReferralHero custom tracking method.

**Step 3:** Click on the form to select it, then select each input field (like **Name**, **Email**, and **Phone**) individually.

**Step 4:** With a field selected, go to the **Element Settings** panel (usually found on the right side of the screen).

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fq4Hr2tsyBqosL0GyGDoA%2Fimage5.png?alt=media&#x26;token=97c3e515-0c0a-4c42-b80b-74c7e166b5a9" alt="" width="242"><figcaption></figcaption></figure>

**Step 5:** Under the **ID** section, enter a unique ID for each field. For example:

* Set the ID of the email field to `email-field`.
* Set the ID of the name field to `name-field`.
* Set the ID of the phone field to `phone-field`.
* Set the ID of the submit button to `Submit`.

**Step 6:** Once the IDs are set, go to **Page Settings > Custom Code**.

**Step 7:** In the **Head Code** section, add the following JavaScript code. This script waits until the page is fully loaded, captures the form data on submit, and then sends it to ReferralHero:

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FoQ03dlSf2UBrNLpFzZIk%2Fimage6.png?alt=media&#x26;token=f82e94aa-2ca5-4334-a28e-1fd1ca1de4ac" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Important:**

* Replace `RH_MFxxxxxxxxx` with your actual ReferralHero campaign ID.
* Confirm that `signup-form` matches the **ID** of your form in Webflow. Adjust as necessary if your form has a different ID.
* To learn more about ReferralHero JavaScript custom methods, Click [here](https://berylsystems.gitbook.io/referral-hero-documentation/integrations/javascript-web-api).
  {% endhint %}

**Step 8:** Save your changes and publish the site. This code will intercept the form submission, capture the data from each field, and send it to ReferralHero using the custom method.
