> 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

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="/files/h7ANsVhqECCirq0LFcym" 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="/files/76zPHvdDXaugLVSa7fgH" 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="/files/qTasLXygNSgvsUWF8cuo" 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="/files/8epwZjo7oQw8DvyWF95j" 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="/files/G8Kd9H5Ltjr1QpTrqyAI" 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 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/script-management/gtm-example-google-ads-user-provided-data.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.
