> For the complete documentation index, see [llms.txt](https://support.referralhero.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.referralhero.com/integrate/javascript-web-api/getting-started.md).

# Getting Started

The first and most crucial step is to install the **ReferralHero Global Tracking Code** on your website. This step is mandatory to ensure that your referral campaign can track user activities across your site and function correctly.

**Follow these steps to add the Tracking Code to your website:**

**Step 1 : Access Your Campaign Dashboard:**

* Log in to your ReferralHero account.
* Navigate to your campaign dashboard and select **Launch**.
* Copy your unique Global Tracking Code from this section.

<figure><img src="/files/NV4Kg9MyL3Dg5YO0Ogzs" alt=""><figcaption></figcaption></figure>

**Step 2 : Add the Tracking Code to Your Website:**

* Insert the **Global Tracking Code** into the `<head>` section of your website's HTML. This ensures the code is loaded on every page of your site, enabling comprehensive tracking of user interactions.
* **Verify the Installation**: Ensure that the code is correctly placed by checking your site's source code or using browser developer tools.

<figure><img src="/files/dqjX6Mj4mtLjphGK6kmx" alt=""><figcaption></figcaption></figure>

**Step 3 : Enable the Global RH Object**:

* Once the Global Tracking Code is installed, your web pages will have access to the global `window.RH` object. This object is essential for interacting with ReferralHero’s features and tracking user actions.

By completing these steps, you ensure that your website is fully integrated with ReferralHero.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://support.referralhero.com/integrate/javascript-web-api/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
