> 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/consent-transmission-standards/google-consent-mode/activation-via-google-tag-manager.md).

# Activation via Google Tag Manager

If you wish to activate Google Consent Mode via Google Tag Manager (GTM), to have more control over its behavior or to load the Sirdata CMP scripts from GTM for example, that's entirely possible. Start by downloading this tag template "*Sirdata\_Google Consent Mode.tpl*" :

{% file src="/files/vyfMWLzcIzNh6xt0M6DT" %}

Then go to your [GTM account](https://tagmanager.google.com/), in the "*Templates*" section, and click on "*New*" 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%2FcmLqIaUMNG1fAf1WffAJ%2Fimage.png?alt=media&amp;token=34a741f6-713a-430f-b96f-b94c83c26570" alt=""><figcaption></figcaption></figure>

Then click on the three dots in the top right corner (![](https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FoZ2J6HG7EhSLlzzJ3Yyx%2Fimage.png?alt=media\&token=a7f9c9a5-275a-406f-9a96-d2036ffe1699)) and then on "*Import*".

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2F4oO6HhWjpp6gDbkz7Emz%2Fimage.png?alt=media&amp;token=ac693048-c253-42d1-ae17-257fcb75cba3" alt=""><figcaption></figcaption></figure>

Select the file "*Sirdata\_Google Consent Mode.tpl*" that you previously downloaded and upload it.

Then click on ![](https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FAME5mby47DAXisSDftj3%2Fimage.png?alt=media\&token=460fe24c-0b41-420b-8407-c21938434d85)at the top right without changing anything, and then exit the editor using the close cross in the top left.

Go to the "*Tags*" section, and create a new one by selecting the new tag type "*Sirdata | Google Consent Mode*" which 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%2F8fRld8gyd0gA2FHIi4ng%2Fimage.png?alt=media&amp;token=274199d7-cc3c-44e5-a3ed-3a75b206a0e5" 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:

<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 if you wish to load the CMP from GTM:

<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!**

{% hint style="info" %}
Please visit the official [Google Consent Mode](https://support.google.com/analytics/answer/9976101?hl=en) page for more information
{% endhint %}

{% hint style="danger" %}
**WARNING**: Google Consent Mode does not cover given aspects related to the GDPR, such as the legal basis for processing personal data or potential data transfer to the United-States when they are based on the Standard Contractual Clauses of the European Union for example.

Please refer to the section dedicated to [Sirdata Analytics Helper](https://helper.docs.sirdata.net/v/english/) if your desire is to secure data transfers to Google Analytics in the United-States.
{% endhint %}


---

# 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/consent-transmission-standards/google-consent-mode/activation-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.
