# Google Tag Manager

{% hint style="warning" %}
**IMPORTANT**

Google Tag Manager is often targeted by AdBlocker and extensions such as Ghostery, which means that some people might block Google Tag Manager when visiting your website. When this happens, ReferralHero will not be loaded.
{% endhint %}

**Step 1**: Login in Google Tag Manager and go to the container you want to use.

**Step 2**: Click  **Add a new tag.**&#x20;

**Step 3:** Give it a name (e.g: ReferralHero Tracking Code) and select Custom HTML

**Step 4:** Go to your campaign dashboard *> Installation instructions* and copy the **Tracking Code**&#x20;

**Step 5:** In the textarea, paste the ReferralHero Tracking Code.

![](/files/-LuiHRGHuNGXowtrNeQq)

**Step 6**: Now we need to tell Google Tag Manager when trigger the script. Scroll down to the **Triggering** section, click on it and choose when to trigger the tag. We highly recommend selecting **All pages** to load the ReferralHero Tracking code on all your pages but feel free to set up another targeting rule.

![](/files/-LuiHWCbVE-NHOcJrUWv)

**Step 7**: Save your tag.

**Step 8**: Click the **Submit** button on the upper right-hand side of the page to publish your changes. The ReferralHero Tracking Code will be automatically loaded on every page!

## How can I track sign-ups in Google Analytics?

To track a sign-up in Google Analytics simply use the **afterSuccess** callback and choose which events you want to send.

```markup
<script type="text/javascript">
  window.RHConfig = {
      callbacks: {
        afterSuccess: function(output) {
          if (output.response == "subscriber_created") {
            ga('send', 'event', 'ReferralHero', 'sign-up', 'Waiting List');
          }
        }
      }
  }
</script>
```


---

# 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/integrate/platform/google-tag-manager.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.
