> 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-of-basic-google-consent-mode/via-google-tag-manager.md).

# Via Google Tag Manager

If you wish to activate Google's Basic 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, this is entirely possible.

Go to your [GTM account](https://tagmanager.google.com/), navigate to the "Templates" section, and click on "Search Gallery" in the "Tag Templates" table.

<figure><img src="/files/9PGHRmncUx5Y8eNTqqB8" alt=""><figcaption></figcaption></figure>

Search for "Sirdata CMP | Google Consent Mode"

<figure><img src="/files/JY44AS7huxZgmAVwaE5T" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/kWmUtyoT9hnKOdQmrBcx" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/LCOUZZT9LwPuoeJiFiTQ" alt=""><figcaption></figcaption></figure>

In the configuration section, click on ![](https://cmp.docs.sirdata.net/~gitbook/image?url=https%3A%2F%2F2240931758-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MUspPnkTFMlMDdGxvAb-2584506019%252Fuploads%252FQdtOYBgkhkSpsbMk05Ni%252Fimage.png%3Falt%3Dmedia%26token%3Dca1ca138-fc0a-4b31-926d-de8b526d5b58\&width=300\&dpr=4\&quality=100\&sign=1e0b79b7\&sv=1) to add a configuration:

<figure><img src="/files/dAL6WBRFu5H5GYrdAJTM" alt=""><figcaption></figcaption></figure>

Select your criteria or keep the default suggestion (Refer to the official [Google Consent Mode page](https://support.google.com/analytics/answer/9976101?hl=en) for more information on these criteria if needed) :

<figure><img src="/files/8Nk7YC233iMOtrZjfazU" alt=""><figcaption></figcaption></figure>

Repeat the operation if necessary, for example, if you are making configurations differentiated by country. Click here for more information on these criteria.

Then configure your advanced options and enter your partner and configuration IDs if you wish to load the CMP from GTM :

<figure><img src="/files/LoYjSIaqb1r7SF0IwuE8" 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 the Tag Manager.
{% endhint %}

Finally, select the trigger *"Consent Initialization - All Pages"* and ![](https://cmp.docs.sirdata.net/~gitbook/image?url=https%3A%2F%2F2240931758-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MUspPnkTFMlMDdGxvAb-2584506019%252Fuploads%252FuHUGijsyoVnfdyHKHtgk%252Fimage.png%3Falt%3Dmedia%26token%3D5e304641-9beb-4e08-ae13-cef0f3b89636\&width=300\&dpr=4\&quality=100\&sign=585b2bd6\&sv=1)<br>

<figure><img src="/files/lg0E2XhfgR1EIfx3eROT" alt=""><figcaption></figcaption></figure>

Test using the preview mode, and publish if everything works as expected.

To complete the configuration of Basic Google Consent Mode, you need to condition the Google tags (Google Analytics, Google Ads, Google Floodlight, etc.).

**a) Conditioning Google Analytics**

* Create a Custom Event trigger with "sirdataConsent" in the "Event Name" field.
* Create a data layer variable named "sirdataExtraVendors".

<figure><img src="/files/PN8sBSgwSaqF6PmRCZJO" alt=""><figcaption></figcaption></figure>

* Add the "sirdataExtraVendors" variable to your trigger by setting it to "contains" and the ExtraVendor ID "|8|".
* Add a second data layer variable named "sirdataPurposes" :

<figure><img src="/files/EcJUE5yg6cucGOwxcFeH" alt=""><figcaption></figcaption></figure>

* Add 3 variables 'sirdataPurposes' for purposes |1|, |9|, and |10| as follows:

<figure><img src="/files/75OLoCjbfAhD25KxNdt3" alt=""><figcaption></figcaption></figure>

* To finish, add your "sirdataConsent Google Analytics" trigger to your GA4 tag :

<figure><img src="/files/ZCNJsryAfdebFJpBIHBK" alt=""><figcaption></figcaption></figure>

#### b) Conditioning Google Ads

* Create a custom event trigger with "sirdataConsent" in the "Event Name" field.
* Create a first data layer variable named "sirdataVendors" :

<figure><img src="/files/8LHMmgi9MU5z0iXO7dRA" alt=""><figcaption></figcaption></figure>

* Add the variable "sirdataVendors" to your trigger by setting it to "contains" and the Vendor ID "|755|".
* Add a second data layer variable named "sirdataPurposes":

<figure><img src="/files/YiKEp72ezg6SyqXujXvD" alt=""><figcaption></figcaption></figure>

* Add 3 custom events 'sirdataPurposes' for purposes |1|, |3|, and |4| as follows :

<figure><img src="/files/FYzz6Dm2gXZQ9bYhqUVV" alt=""><figcaption></figcaption></figure>

To finish, add your "sirdataConsent Google Advertising Products" trigger to your Google Ads tag:

<figure><img src="/files/9T93leTnSlZcPO3UK2uD" alt=""><figcaption></figcaption></figure>


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cmp.docs.sirdata.net/en/consent-transmission-standards/google-consent-mode/activation-of-basic-google-consent-mode/via-google-tag-manager.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
