> For the complete documentation index, see [llms.txt](https://docs.hockeystack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hockeystack.com/technical-details/tracking/implementation/google-tag-manager.md).

# Google Tag Manager

> Google Tag Manager (GTM) is sometimes blocked by certain adblockers, which can affect the accuracy of your HockeyStack data. To ensure the most reliable tracking and insights, we recommend implementing our website tracking script directly on your site. This approach helps prevent data loss and gives you a clearer picture of your users’ behavior.

1. In the menu on the left, click **Tags**.
2. Click **New**.
3. Click on the **Tag configuration** box. In the **Choose tag type** list select **Custom HTML**.
4. Paste the code snippet on your dashboard in the **HTML** box that appears.
5. Click **Advanced Settings** below the box.
6. Set the **Tag firing priority** to 100.
7. Set the **Tag firing options** to **Once per page**.
8. Click the **Triggering** box.
9. Under **Choose a trigger,** select **All Pages** to enable HockeyStack to track your entire site.
10. Enter "HockeyStack" as the name for your code in the upper left corner.
11. In the upper right corner of the overview click **Submit**.
12. Give the new version a descriptive name and click **Publish**.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hockeystack.com/technical-details/tracking/implementation/google-tag-manager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
