> 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/standards-de-transmission-du-consentement/google-consent-mode/corriger-les-erreurs-dimplementation/mauvais-nom-de-data-layer.md).

# Mauvais nom de data layer

#### Description

Au moins un service Google détecté sur la page **n’utilise pas le nom de data layer par défaut `dataLayer`**. Cela peut entraîner des incohérences dans le déclenchement des balises ou dans la transmission des signaux de consentement, notamment si plusieurs `dataLayer` coexistent ou si la CMP n’interagit pas avec le bon objet global.

#### Causes possibles

* Une ou plusieurs balises Google (Google Ads, Google Analytics, etc.) ont été configurées pour utiliser un **nom de data layer personnalisé** (ex. : `myDataLayer`, `gtmDataLayer`, etc.).
* Si la CMP **n’est pas chargée via Google Tag Manager**, elle suppose par défaut que le nom du data layer est `dataLayer`, sauf indication contraire.

#### Que faire

**Solution recommandée :**

* **Harmoniser l’utilisation d’un seul nom de data layer** sur l’ensemble du site (de préférence `dataLayer`, sauf nécessité particulière).

**Si vous choisissez volontairement un autre nom que `dataLayer` et que la CMP n’est pas chargée via GTM :**

* Déclarez explicitement ce nom **avant le chargement de la CMP** à l’aide de la variable suivante :

<pre class="language-javascript"><code class="lang-javascript">&#x3C;script>
    window.ABconsentCMP = window.ABconsentCMP || {};
<strong>    window.ABconsentCMP.gtmDataLayerName = "NOM_DU_DATALAYER_PERSONNALISÉ";
</strong><strong>&#x3C;/script>
</strong></code></pre>

<figure><img src="https://2240931758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUspPnkTFMlMDdGxvAb-2584506019%2Fuploads%2Fq6jnUI01kuMLr9q67tMx%2Fimage.png?alt=media&amp;token=98239248-c17a-41ae-9ee6-bf1aafca805b" alt=""><figcaption></figcaption></figure>


---

# 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://cmp.docs.sirdata.net/standards-de-transmission-du-consentement/google-consent-mode/corriger-les-erreurs-dimplementation/mauvais-nom-de-data-layer.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.
