> 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/script-management/gtm-example-google-ads-user-provided-data.md).

# GTM Example: Google Ads User-provided Data Event

Advanced conditioning in Google Tag Manager

This guide explains how to condition the **Google Ads User-provided Data Event** tag in Google Tag Manager (GTM) using the variables and events injected by the Sirdata CMP.

{% hint style="info" %}
The Sirdata CMP automatically pushes consent choices into the GTM dataLayer via the `sirdataConsent` event. The `sirdataExtraPurposes` and `sirdataExtraVendors` variables contain the consented Sirdata purposes and vendors respectively, in `|ID|` format (e.g.: `|9|`, `|10|`, `|101|`).
{% endhint %}

## 1) Create the "User-provided data" variable

In GTM, create a variable of type **Google Ads User-provided Data**:

1. **Variable type**: Google Ads User-provided Data
2. **Collection mode**: Automatic collection or manually set the collection rules

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FoJRzrcn4dueHv6SNbSPI%2Fimage.png?alt=media&amp;token=9c6c1344-b5eb-42e8-a91e-4ad1e8ebb975" alt=""><figcaption></figcaption></figure>

## 2) Create the "sirdataExtraPurposes" variable

Create a variable of type **Data Layer Variable**:

1. **Data Layer Variable Name**: `sirdataExtraPurposes`

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FVuOfjPhEYN0HeIcZ3hMJ%2Fimage.png?alt=media&amp;token=814e607d-7d6a-4a4e-85b6-078a8c549460" alt=""><figcaption></figcaption></figure>

## 3) Create the "sirdataExtraVendors" variable

Create a variable of type **Data Layer Variable**:

1. **Data Layer Variable Name**: `sirdataExtraVendors`

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FMSkGq9KhIgqwCvbWajOC%2Fimage.png?alt=media&amp;token=2609567a-9bf9-4281-835c-5a58a71e0a16" alt=""><figcaption></figcaption></figure>

## 4) Create the "sirdataConsent" trigger

Create a trigger of type **Custom Event**:

1. **Event name**: `sirdataConsent`
2. Select the **Some custom events** option
3. Add the following conditions:
   * `{{sirdataExtraPurposes}}` **contains** `|9|` — Automatic collection of identifiers on devices
   * `{{sirdataExtraPurposes}}` **contains** `|10|` — Processing of identification data
   * `{{sirdataExtraVendors}}` **contains** `|101|` — Google Customer Match, Enhanced & Offline Conversions

{% hint style="warning" %}
All three conditions must be met (logical AND) for the trigger to fire.
{% endhint %}

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FvNRNBcBt1J7i9LmaghnT%2Fimage.png?alt=media&amp;token=6830f8d5-5a9a-45f3-a774-e22e8d61f5b6" alt=""><figcaption></figcaption></figure>

## 5) Add the "Google Ads User-provided Data Event" tag

Create a tag of type **Google Ads User-provided Data Event**:

1. **Google Ads Account ID**: enter your account ID
2. **User-provided data**: select the variable created in step 1
3. **Trigger**: select the trigger created in step 4

<figure><img src="https://1869615683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-1972196547%2Fuploads%2FxoBaHYMt4DTaNK5x0B6W%2Fimage.png?alt=media&amp;token=80943f7b-edfc-43be-ac9a-9984fb58e4dc" alt=""><figcaption></figcaption></figure>

The tag will now only fire when the user has consented to Sirdata purposes 9 and 10 as well as the Google Customer Match partner (ID 101).


---

# 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/script-management/gtm-example-google-ads-user-provided-data.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.
