# Google Tag Manager

> Integrate Google Tag Manager with your Mintlify documentation to manage analytics tags, conversion tracking, and marketing events centrally.

Add your tag ID to your `docs.json` file and Mintlify injects the Google Tag Manager script into all your pages.

Your tag ID is the container ID displayed in your Google Tag Manager workspace, formatted as `GTM-XXXXXXX`.

You are responsible for setting up cookie consent banners with Google Tag Manager if you need them.

After publishing your changes, use Google Tag Manager's preview mode to confirm that your container loads on your docs site.

:::code-group
```json Analytics options in docs.json theme={null}
"integrations": {
    "gtm": {
        "tagId": "required"
    }
}
```

```json Example theme={null}
"integrations": {
    "gtm": {
        "tagId": "GTM-MGBL4PW"
    }
}
```
:::

## Related topics

- [Analytics integrations](/docs/integrations/analytics/overview.md)
- [Content Security Policy (CSP) configuration](/docs/deploy/csp-configuration.md)
- [docs.json schema reference](/docs/organize/settings-reference.md)

## Related pages

- [Adobe Analytics](./integrations-analytics-adobe.md)
- [Amplitude](./integrations-analytics-amplitude.md)
- [Clarity](./integrations-analytics-clarity.md)
- [Clearbit](./integrations-analytics-clearbit.md)
- [Fathom](./integrations-analytics-fathom.md)
- [Google Analytics 4](./integrations-analytics-google-analytics.md)
- [Heap](./integrations-analytics-heap.md)
- [Hightouch](./integrations-analytics-hightouch.md)
- [Hotjar](./integrations-analytics-hotjar.md)
- [LogRocket](./integrations-analytics-logrocket.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
