> For the complete documentation index, see [llms.txt](https://doc.commandersact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.commandersact.com/fr/fonctionnalites/consent-management/knowledge-base/iab-tcf-v2.3-consent.md).

# Consentement IAB TCF V2.4

Si vous utilisez l’option IAB TCF (voir [cette page](https://www.doc.commandersact.com/consent-management/user-guides/settings#iab-tcf-compliancy) pour configurer IAB TCF sur votre compte), vous pourrez utiliser le `__tcfapi` à l’endroit où votre bannière de confidentialité est déployée.

Cette fonction est définie dans votre conteneur et dans votre bannière de confidentialité afin que vous puissiez l’utiliser avant que le chargement de cette dernière soit terminé. IAB l’appelle parfois le `TCF API stub`.

Le consentement IAB TCF est encodé dans un format appelé `Consent-String`.

### Comment utiliser l’API TCF

La méthode recommandée pour obtenir la valeur de la chaîne de consentement TCF (`tcData.tcString` dans l’exemple ci-dessous) consiste à utiliser la commande `addEventListener` .

```javascript
__tcfapi('addEventListener', 2, (pingReturn, success) =>{
 if(success &&
    (pingReturn.eventStatus === 'tcloaded' || pingReturn.eventStatus === 'useractioncomplete')) {
 
    // do something with pingReturn.tcString

  } else {

    // do something else

  }
});
```

Parfois, vous ne souhaitez pas être averti des mises à jour du consentement. Pour cela, vous pouvez utiliser le code plus avancé ci-dessous :

```javascript
__tcfapi('addEventListener', 2, function(pingReturn, success) {
  if(success &&
    (pingReturn.eventStatus === 'tcloaded' || pingReturn.eventStatus === 'useractioncomplete')) {

    // do something with pingReturn.tcString

    // remove ourselves to not get called more than once
    __tcfapi('removeEventListener', 2, pingReturn.listenerId);

  } else {

    // do something else

  }
});
```

* Référence : [Commandes IAB TCF](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#what-required-api-commands-must-a-cmp-support)

### Comment décoder la Consent-String

Vous pouvez copier-coller une `Consent-String` sur cette page : <https://iabtcf.com/#/decode>.

* Référence : [Format de la Consent-String IAB TCF](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md)

### Google Additional Consent Mode

Il s’agit d’une extension facultative d’IAB TCF.\
\
Une fois configurée dans les paramètres de gestion du consentement, une propriété supplémentaire `addtlConsent` sera disponible dans l’objet `tcData` .

```javascript
__tcfapi('addEventListener', 2, function(pingResult, success) {
  if(success &&
    (pingResult.eventStatus === 'tcloaded' || pingResult.eventStatus === 'useractioncomplete')) {

    // do something with pingResult.addtlConsent

  } else {
```


---

# 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://doc.commandersact.com/fr/fonctionnalites/consent-management/knowledge-base/iab-tcf-v2.3-consent.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.
