> 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).

# Consent IAB TCF V2.3

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` où votre privacy banner est déployée.

Cette fonction est définie dans votre container et dans votre privacy banner afin que vous puissiez l'utiliser avant que votre privacy banner ait fini de se charger. Elle est parfois appelée par IAB le `stub de l'API TCF`.

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

### Comment utiliser l'API TCF

La méthode recommandée pour obtenir la valeur du consent-string de TCF (`tcData.tcString` dans l'exemple ci-dessous) consiste à utiliser la `addEventListener` commande.

```javascript
__tcfapi('addEventListener', 2, (pingReturn, success) =>{
 if(success &&
    (pingReturn.eventStatus === 'tcloaded' || pingReturn.eventStatus === 'useractioncomplete')) {
 
    // faire quelque chose avec pingReturn.tcString

  } else {

    // faire autre chose

  }
});
```

Parfois, vous ne souhaitez pas être notifié des mises à jour du consentement. Vous pouvez y parvenir en utilisant le code plus avancé ci-dessous :

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

    // faire quelque chose avec pingReturn.tcString

    // nous retirer pour ne pas être appelés plus d'une fois
    __tcfapi('removeEventListener', 2, pingReturn.listenerId);

  } else {

    // faire autre chose

  }
});
```

* 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 le Consent-String

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

* Référence : [Format du 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 à IAB TCF.\
\
Une fois configurée dans Consent Management Settings, un addtlConsent supplémentaire `addtlConsent` propriété sera disponible sur le `tcData` objet.

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

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