---
title: "Academy App"
canonical_url: "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2"
locale: en
meta:
  "og:title": "Academy App"
---

[Go to home](https://academy.laioutr.com/en)

- [Apps](https://academy.laioutr.com/en/bereiche/apps)

- [Tracking and consent](https://academy.laioutr.com/en/leitfaeden/tracking-and-consent-apps)

- [Add Google Tag Manager with Consent Mode v2](https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2)

# Add Google Tag Manager with Consent Mode v2

The Google Tag Manager app loads the GTM container into the storefront, sets all consent signals to "denied" up front and releases them only after visitors decide. After analytics consent, storefront events reach the data layer with GA4 names.

## Before you start

<dl>

<dt>Plan</dt>
<dd>Any Laioutr licence; Google Tag Manager account</dd>

<dt>Role</dt>
<dd>Developer role on the environment to save settings in Configuration</dd>

<dt>Duration</dt>
<dd>8 min</dd></dl>

### Prerequisites

- GTM container and its ID (GTM-XXXXXX)
- Consent app such as Cookiebot or CCM19
- Tags and triggers in the GTM container, for example for GA4

Last reviewed on October 15, 2026

Loads the Google Tag Manager container, sets Google Consent Mode v2 to "denied" up front, sends one complete update after visitors decide and passes storefront events with GA4 names to the data layer.

[Developer documentation](https://docs.laioutr.com/apps/app-docs/gtm)

## How it works

1. Create a container and copy its IDWhere: Google Tag Manager · Role: Marketing or developer · Duration: 10 min
2. Install and configure a consent appWhere: Cockpit, Apps and Configuration · Role: Developer · Duration: 10 min
3. Install the GTM appWhere: Cockpit, Apps · Role: Developer · Duration: 2 min
4. Enter containerId and optional values, saveWhere: Cockpit, Configuration · Role: Developer · Duration: 3 min
5. Start a deploymentWhere: Cockpit, Deployments · Role: Developer · Duration: 5 min
6. Create tags and triggers, test with previewWhere: Google Tag Manager · Role: Marketing · Duration: 30 min

## Configuration

| Field | Purpose | Where to find it | Required | Per environment |
| --- | --- | --- | --- | --- |
| `containerId` | ID of the GTM container. A single ID applies to all markets; a mapping from market ID to container ID gives each market its own container. | Google Tag Manager, container overview (format GTM-XXXXXX) | Yes | Yes |
| `layer` | Name of the data layer variable in the browser. | Default dataLayer; change only for a custom name in the GTM setup. | No | Yes |
| `consentUpdates` | Defines who sends consent updates to Google: store (default, the app based on the consent app) or external (the consent app itself). | Project decision, depending on the consent app | No | Yes |

## Common errors

<dl>

<dt>Tags do not fire, even after consent.</dt>
<dd>**Cause:** No consent app is active, so the "denied" default remains.</dd>
<dd>**Fix:** Install and configure Cookiebot or CCM19 and redeploy.</dd>

<dt>Events such as add_to_cart are missing from the data layer.</dt>
<dd>**Cause:** The analytics purpose is not granted, or the data layer name in layer differs from the GTM setup.</dd>
<dd>**Fix:** Test with statistics consent given and align layer with the name in the GTM setup.</dd>

<dt>Consent updates arrive twice.</dt>
<dd>**Cause:** Both the consent app and the GTM app send Consent Mode.</dd>
<dd>**Fix:** Set consentUpdates to external or disable Consent Mode in the consent app.</dd>

<dt>No container loads in one market.</dt>
<dd>**Cause:** containerId is set as a per-market mapping and the market is missing from it.</dd>
<dd>**Fix:** Add the market ID with a container ID, save and redeploy.</dd></dl>

The **Google Tag Manager** app (package `@laioutr-app/gtm`) adds a GTM container to the storefront. It does three things: at the very start of every page it sets Google Consent Mode v2 to "denied" for all consent-gated signals, with only `security_storage` granted. Then it loads the container. As soon as visitors decide in the banner, it sends exactly one complete consent update, including for a revocation.

The app is also a destination for Laioutr tracking. Events from components and apps receive GA4 names, so `ecommerce/add_to_cart` becomes `add_to_cart`. Amounts are converted to major currency units, and categories are spread across `item_category` to `item_category5`. Nothing reaches the data layer until the analytics purpose is granted.

Without a consent app, everything stays "denied". Tags, triggers and variables are still maintained in the GTM container. Server-side tracking is a separate add-on and not part of this app.

## Step by step

1. 1 ### Step 1: Note the container ID

   Open the container in Google Tag Manager and copy the ID in the format `GTM-XXXXXX`.
2. 2 ### Step 2: Provide a consent app

   Install and configure Cookiebot or CCM19. Without a consent app, all signals stay "denied".
3. 3 ### Step 3: Install the app

   Open **Apps** in the project, find Google Tag Manager in the **Tracking** tab and select **Install**.
4. 4 ### Step 4: Enter the settings

   Enter the `containerId` in **Configuration**. Change `layer` only for a custom data layer name, and set `consentUpdates` to `external` if the consent app sends Consent Mode itself. Select **Save settings**.
5. 5 ### Step 5: Start a deployment

   Start a new deployment with **Deploy** under **Deployments**.
6. 6 ### Step 6: Test with GTM preview

   Connect Google Tag Manager preview mode to the storefront, accept in the banner and check that the consent update and events such as `add_to_cart` arrive.

## Check the result

In GTM preview, the first entry shows the consent default with "denied". After consent, a consent update with "granted" follows for the allowed signals. Clicking "Add to cart" creates the event `add_to_cart` with item data in the data layer.

## Frequently asked questions

Does the app need a consent banner?

Yes. Only a consent app such as Cookiebot or CCM19 reports the visitors' decision. Without one, all signals stay "denied" and no tags store data.

Can each market have its own container?

Yes. Instead of a single ID, `containerId` also accepts a mapping from market ID to container ID. Markets without an entry get no container.

When is consentUpdates set to external?

When the consent app sends Google Consent Mode itself. This prevents two sources from sending updates for the same signals. The "denied" default at the start of the page stays with the app in both cases.

Is server-side tracking included?

No. The app works in the browser. Server-side tracking is the Server Side Tracking add-on.

## Related

- [Set up tracking: connect Google Tag Manager](https://academy.laioutr.com/en/artikel/set-up-tracking-connect-google-tag-manager)10 min

  To set up tracking, install a consent app and the Google Tag Manager app, enter the container ID per environment and deploy. Storefront events then arrive in the data layer with GA4 names as soon as the visitor consents to statistics.
- [Tracking and consent built into the components](https://academy.laioutr.com/en/artikel/tracking-and-consent-built-into-the-components)6 min

  Laioutr components send events such as page view, product view, add to cart and purchase through one analytics layer. Each event only reaches the destinations the visitor has consented to.
- [Set up a consent banner with Cookiebot or CCM19](https://academy.laioutr.com/en/artikel/set-up-a-consent-banner-with-cookiebot-or-ccm19)10 min

  Laioutr connects Cookiebot or CCM19 as a consent app. Once installed and configured with its IDs, the storefront shows the banner, and all tracking destinations and Google Consent Mode v2 follow the visitor's decision automatically.
- [Set up Cookiebot as consent banner](https://academy.laioutr.com/en/apps/set-up-cookiebot-consent-banner)7 min

  The Cookiebot app shows the Cookiebot banner in the storefront and reports the visitors' decision to the Laioutr consent store, which tracking, GTM and other apps follow. Only the Cookiebot domain group ID (CBID) is required.

## [Tracking and consent](https://academy.laioutr.com/en/leitfaeden/tracking-and-consent-apps)

Search this guide

1. [Add Google Tag Manager with Consent Mode v2](https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2)8 min
2. [Set up Cookiebot as consent banner](https://academy.laioutr.com/en/apps/set-up-cookiebot-consent-banner)7 min
3. [Set up CCM19 as consent banner](https://academy.laioutr.com/en/apps/set-up-ccm19-consent-banner)8 min

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://academy.laioutr.com/#website",
      "@type": "WebSite",
      "inLanguage": "en",
      "name": "Default",
      "url": "https://academy.laioutr.com/",
      "translationOfWork": {
        "@id": "https://academy.laioutr.com/#website"
      }
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#webpage",
      "name": "Academy App",
      "url": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2",
      "@type": [
        "WebPage",
        "FAQPage"
      ],
      "breadcrumb": {
        "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#breadcrumb"
      },
      "isPartOf": {
        "@id": "https://academy.laioutr.com/#website"
      },
      "mainEntity": [
        {
          "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/1"
        },
        {
          "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/2"
        },
        {
          "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/3"
        },
        {
          "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/4"
        }
      ],
      "potentialAction": [
        {
          "@type": "ReadAction",
          "target": [
            "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2"
          ]
        }
      ]
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#breadcrumb",
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "name": "Home",
          "item": "https://academy.laioutr.com/en",
          "position": 1
        },
        {
          "@type": "ListItem",
          "name": "Apps",
          "item": "https://academy.laioutr.com/en/bereiche/apps",
          "position": 2
        },
        {
          "@type": "ListItem",
          "name": "Tracking and consent",
          "item": "https://academy.laioutr.com/en/leitfaeden/tracking-and-consent-apps",
          "position": 3
        },
        {
          "@type": "ListItem",
          "name": "Add Google Tag Manager with Consent Mode v2",
          "item": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2",
          "position": 4
        }
      ]
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/1",
      "@type": "Question",
      "inLanguage": "en",
      "name": "Does the app need a consent banner?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "<p>Yes. Only a consent app such as Cookiebot or CCM19 reports the visitors' decision. Without one, all signals stay \"denied\" and no tags store data.</p>"
      }
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/2",
      "@type": "Question",
      "inLanguage": "en",
      "name": "Can each market have its own container?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "<p>Yes. Instead of a single ID, <code>containerId</code> also accepts a mapping from market ID to container ID. Markets without an entry get no container.</p>"
      }
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/3",
      "@type": "Question",
      "inLanguage": "en",
      "name": "When is consentUpdates set to external?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "<p>When the consent app sends Google Consent Mode itself. This prevents two sources from sending updates for the same signals. The \"denied\" default at the start of the page stays with the app in both cases.</p>"
      }
    },
    {
      "@id": "https://academy.laioutr.com/en/apps/google-tag-manager-with-consent-mode-v2#/schema/question/4",
      "@type": "Question",
      "inLanguage": "en",
      "name": "Is server-side tracking included?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "<p>No. The app works in the browser. Server-side tracking is the Server Side Tracking add-on.</p>"
      }
    }
  ]
}
```
