> For the complete documentation index, see [llms.txt](https://cmp.docs.sirdata.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmp.docs.sirdata.net/en/install/via-a-tag-manager/loading-via-google-tag-manager.md).

# Loading via Google Tag Manager

\
If you want to load the Sirdata CMP via Google Tag Manager (GTM), you must also enable Google Consent Mode via GTM to have more control over its behavior. To do this, go to your GTM account, navigate to the "Templates" section, and click on "Search Gallery" in the "Tag Templates" table.

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2Fr1InBrAYZYDok4bCaFbc%2FEN%20GTM%201.png?alt=media&amp;token=3fbbd3b1-ab80-4d0e-ba3c-9ad87d9fa8b1" alt=""><figcaption><p>Tag templates</p></figcaption></figure>

Search for "Sirdata CMP | Google Consent Mode"

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2F3sgXG9ln25jiFWzkcqlb%2FEN%20GTM%202.png?alt=media&amp;token=2a08cbdb-1844-4a3c-af53-b5e7cdb4e0fa" alt=""><figcaption><p>"Import a tag template"</p></figcaption></figure>

Add the "Sirdata CMP | Google Consent Mode" template to the workspace.

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FWTvmFO0wxS1ZSX0aQJP9%2FEN%20GTM%203.png?alt=media&amp;token=fbf740b7-c0b6-4457-a81e-f0f9acc77f9c" alt=""><figcaption><p>"Add the template"</p></figcaption></figure>

Go to the "Tags" section, then create a new one by selecting the new tag type "Sirdata CMP | Google Consent Mode" that now appears in the custom tags.

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FDay5R1HW4tIJwqA7Vg5i%2FEN%20GTM%204.png?alt=media&amp;token=d5fc7b4d-9daa-4664-9fef-41430565c9aa" alt=""><figcaption></figcaption></figure>

In the configuration part, click on ![](https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FCNL9AyTJKuTLeCPU1sRt%2Fimage.png?alt=media\&token=1e6f81e5-6b9b-4d46-b092-8e03e9c0f68f)to add a configuration:

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FvNNTYcDUVZx1DfBC7kFt%2Fimage.png?alt=media&amp;token=7099de29-8c7b-43ce-a7f0-0135a563f36e" alt=""><figcaption></figcaption></figure>

Select your criteria or **keep the default suggestion in case of doubt**:

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FBrO7VwTEL5tXt490U34Y%2Fimage.png?alt=media&amp;token=a5f5b80a-a6c9-4874-aea4-f82cde8a37f6" alt=""><figcaption></figcaption></figure>

Repeat the operation if necessary, for example if you are making configurations differentiated by country. Click [here](https://developers.google.com/tag-platform/devguides/privacy?hl=en) for more information on these criteria.

Then configure your advanced options and enter your partner and configuration identifiers:

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FCoivJjYjSUydyFObHCRH%2Fimage.png?alt=media&amp;token=2a6e2481-5e40-48c8-91f0-98b11afe7b68" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you do not load the Sirdata CMP from GTM, it is **mandatory** to load it from the site, and the CMP scripts must be loaded **before** Google Tag Manager.
{% endhint %}

Finally, select the trigger "*Consent Initialization - All Pages*" and ![](https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FWfvUCCWIKx4cx1kofJMf%2Fimage.png?alt=media\&token=eafdf4c4-4201-4f25-8c9d-30cb02eb772f).

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FTmr5KeQyYDd5xY3ZDUaZ%2Fimage.png?alt=media&amp;token=8090a360-4eda-4a91-b0c6-4adfbeb5b8cf" alt=""><figcaption></figcaption></figure>

Test via preview, and publish if everything works as expected.

**Congratulations!**


---

# 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://cmp.docs.sirdata.net/en/install/via-a-tag-manager/loading-via-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.
