# Tealium

{% hint style="info" %}
Events and variables used by Tealium are detailed in [this documentation.](/cmp/web-sdk/third-parties/tags-management/events-and-variables.md)
{% endhint %}

## Overview

The key idea of the integration is that Didomi pushes user actions and consent information into Tealium by firing events/direct calls ([`utag.link`](https://docs.tealium.com/platforms/javascript/track/#utag-link)) to indicate when tags that require consent can be loaded. You should then configure load rules in Tealium to only fire tags after consent has been collected for each vendor.

On your side, the integration relies on adding rules, events and conditions to all the tags from vendors that do not support the IAB framework to make them fire on a custom event from the data layer. The Didomi SDK will then fire an event with the list of vendors that the user has given consent to, which will ensure that Tealium only loads the tags matching the user consent.

For instance, after a user gives consent to the vendor `google`, the SDK will push the direct call `didomi-consent-changed` and the variable `didomiVendorsEnabled` with the value `google,`. The tags setup in Tealium can then be fired through a load rule on the event `didomi-consent-changed`.

{% hint style="warning" %}
**Make sure that our SDK is setup**

Before continuing, please read our section on [setting up our SDK](/cmp/web-sdk/getting-started.md) to learn how to do the initial setup of your tag. It is particularly important that our tag gets embedded before all the other tags on your page.
{% endhint %}

## Configure the Didomi / Tealium integration

### Step 1 - Enable the Tealium integration

If you are configuring Didomi through the Console, enable the Tealium integration in you Consent notice -> Cutomization -> Integrations:

<figure><img src="/files/if4xRVQgKzgCgAPIbXCC" alt=""><figcaption><p>Tealium integration in the Didomi Console</p></figcaption></figure>

{% hint style="danger" %}
**Embedding the Didomi SDK through Tealium**

We recommend not embedding the Didomi SDK through Tealium. By being directly on your pages, the Didomi SDK can load faster and also ensures that IAB vendors can detect a CMP on the page as soon as possible.

Embedding the Didomi SDK through Tealium will result in less consents being passed to vendors and a lower consent rate from their perspective.
{% endhint %}

### Step 2 - Add the Events extension

Didomi pushes the user consent status through Tealium events and you will use the `tealium_event` variable to condition your tags.

Enable the Events extension in Tealium to ensure that the `tealium_event` variable is available in the data layer and can be used in load rules:

* [Tealium - Events Extension](https://docs.tealium.com/iq-tag-management/extensions/extensions-list/tealium-events-extension/)
* [Tealium - Add an extension](https://docs.tealium.com/iq-tag-management/extensions/manage/)

### Step 3 - Create load rules

You need to create load rules that will be used to decide when to load each tag in Tealium. Vendors that do not require consent do not need to be updated. [IAB vendors](https://vendor-list.consensu.org/v3/vendor-list.json) do not need to be conditioned either as they will automatically collect the consent status from Didomi through the IAB TCF API.

For every vendor tag that you need to condition on the user consent status, create or update a load rule that loads the tag when consent is collected and consent has been given for the vendor.

For instance, to load a Google vendor tag, create a rule with the following conditions:

* `tealium_event` equals `didomi-ready`
* AND `didomiVendorsEnabled` contains `google,`

{% hint style="warning" %}
When matching vendors by IDs in variables, use the full ID of the vendor with an additional comma (`,`) at the end to ensure IDs do not get mixed and matched.\
Example: Use `google,` to match the vendor with ID `google` and not the vendor with ID `googleana-4TXnJigR`.
{% endhint %}

With this load rule configured, your tag will be fired when the page loads AND consent has been given on a previous page for the vendor Google. If you also want the tag to fire when consent is given on the current page, also add a rule when `tealium_events` equals `didomi-consent-changed`.

For more information on the events and variables available for your load rules:

* See [Events](/cmp/web-sdk/third-parties/tags-management/events-and-variables.md#events) for more information on the values of `tealium_event`.
* See [Variables / Vendors](/cmp/web-sdk/third-parties/tags-management/events-and-variables.md#vendors) for more information on `didomiVendorsEnabled` and other variables available to condition your tags.

**How to find your vendor ID?**

To find your vendor ID, go to the *Vendors and Purposes* section of your Didomi account and copy the API ID. Learn more about variables in [this documentation.](/cmp/web-sdk/third-parties/tags-management/events-and-variables.md#variables)

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

### Custom events and consent

If you have your own custom events that you use as rules for tags and also want to add an additional condition on the consent status of the user, you need to make sure that your custom events only fire after the Didomi event that you are using (so that the Didomi variables have already been populated). You have two options to do so.

Check [this page](/cmp/web-sdk/third-parties/tags-management/events-and-variables/custom-events.md) for more details on custom events.


---

# Agent Instructions: 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:

```
GET https://developers.didomi.io/cmp/web-sdk/third-parties/tags-management/tag-managers/tealium.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
