# Manage GTM by purposes

This page explains how to trigger a GTM tag according to the processing purposes consented to in the notice by the user. As a publisher, it can be useful to be able to trigger a script without appearing as a non-IAB partner.

The AppConsent CMP automatically triggers 11 events according to the 11 IAB purposes available.

{% hint style="warning" %}
**CAUTION**

If you want to control a non-IAB partner, we recommend you visit this page: [Control your extra vendors](https://docs.sfbx.io/configuration/step-3-notice-implementation-web-app-tv/google-gtm/control-your-extra-vendors-finely).
{% endhint %}

## Trigger creation

Let's start by adding a custom event.

1. Click on the **Triggers** menu
2. Then on the **New** button

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2FNA2qKSMx2RywqnG6PQ4b%2FGTM-extra-vendor-new-trigger.png?alt=media&#x26;token=f6cb9d7a-5615-4ca5-b49a-8cf1f90bc5ce" alt=""><figcaption></figcaption></figure>

3. Click on **Trigger configuration**
4. From the list of events in the right-hand side panel, select **Custom event**

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2FwGsylB1PwT7fSJPWGH6O%2FGTM-extra-vendor-select-custom-event.png?alt=media&#x26;token=a39d9c28-23d9-43ce-81c3-17a003c575a6" alt=""><figcaption></figcaption></figure>

5. In the **Event name** field, enter `appconsent_ctrl_` + the purpose number

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2F7h6Uqzz19ya07HIJPaJ5%2FGTM-by-purpose-name-custom-event.png?alt=media&#x26;token=79dc35b8-7430-471f-b1c6-3feaa4929f4d" alt=""><figcaption></figcaption></figure>

6. Name the event as you like, then save.

Depending on your needs, do the same for **appconsent\_ctrl\_2**, **appconsent\_ctrl\_3** ... **appconsent\_ctrl\_10**.

{% hint style="info" %}
**INFO**

As a reminder, here is the list of purposes according to the [IAB Framework](https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#A_Purposes)**:**

List of purposes :

1. Store and/or access information on a device
2. Use limited data to select advertising
3. Create profiles for personalised advertising
4. Use profiles to select personalised advertising
5. Create profiles to personalise content
6. Use profiles to select personalised content
7. Measure advertising performance
8. Measure content performance
9. Understand audiences through statistics or combinations of data from different sources
10. Develop and improve services
11. Use limited data to select content
    {% endhint %}

## Link the event to a tag

1. Click on the **Tags** menu in the left-hand side panel
2. Then click on the **New** button

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2F71hfgo5kkL4wKKyaZxPv%2FGTM-extra-vendor-new-tag.png?alt=media&#x26;token=a1d2717d-e9fb-4d5c-9362-8534ccbc2038" alt=""><figcaption></figcaption></figure>

3. Click on Tag Configuration
4. Then select the **Custom HTML** template

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2FiZHjOhl55epaz5TqRDdj%2FGTM-extra-vendor-select-custom-html.png?alt=media&#x26;token=3f3315f4-06c9-4988-8d8b-74478120837f" alt=""><figcaption></figcaption></figure>

5. Put the extra vendor's script in the **HTML** field

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2F1DweI50Sq8yo0KzySJ3C%2FGTM-extra-vendor-html.png?alt=media&#x26;token=26b612ef-7adf-4c98-995c-5be1b8e74563" alt=""><figcaption></figcaption></figure>

6. Then click on the **Trigger** section
7. Then select the custom trigger created earlier

<figure><img src="https://4229351976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkyFlZKFaKP4MUM0zILOg%2Fuploads%2FcaiSSFvooZ6N8BzHdC2b%2FGTM-by-purpose-add-trigger-tag-html.png?alt=media&#x26;token=aff22fba-77b6-425e-bede-e590633eda92" alt=""><figcaption></figcaption></figure>

8. Name and save your tag

{% hint style="danger" %}
In this example, we're using the **Custom HTML** template, but it works with other template types.
{% endhint %}

That's it. Now your tag will be fired only if :

* If the processing purpose you have selected is consented by the user.

Have a suggestion ? Just drop an email to <support@sfbx.io>
