\n\n\n\n```\n\nWhen consent is granted:\n\n```js\ngtag('consent', 'update', {\n analytics_storage: 'granted',\n ad_storage: 'granted',\n ad_user_data: 'granted',\n ad_personalization: 'granted'\n});\n```\n\n## In GTM itself\nIf you’re using GTM, configure:\n- **Consent Overview**\n- Tag-level **Consent Settings**\n- Trigger tags only when required consent exists\n\n## Important notes\n- Blocking the **GTM container** completely means **no tags in GTM can run** until consent.\n- Using **Consent Mode** allows Google tags to load in a restricted state, which is often preferred for measurement and compliance.\n- For stricter privacy requirements, avoid loading GTM until the user opts in.\n\nIf you want, I can give you:\n1. a **GTM-only setup**\n2. a **WordPress implementation**\n3. a **React / Next.js example**\n4. a **Cookiebot / OneTrust integration**"}}}

Prompt

Block GTM tags until consent

Technology / Marketing Automation1 observationLast seen Oct 29, 2026

Latest observation

Oct 29, 2026OpenAI APIWeb search: off

To block Google Tag Manager (and any tags fired through it) until consent is granted, you should prevent GTM from loading or running tracking tags before consent.

Best approach

Use a consent manager / CMP and set GTM to only fire after consent via one of these patterns:

1) Load GTM only after consent

Do not include the GTM snippet on page load. Instead:

  • wait for user consent
  • then inject the GTM script dynamically

This is the strictest method.

2) Use Google Consent Mode

Load GTM, but default all ad/analytics storage to denied until consent:

  • analytics_storage: denied
  • ad_storage: denied
  • ad_user_data: denied
  • ad_personalization: denied

Then update consent when the user accepts.

Example:

<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}

  gtag('consent', 'default', {
    analytics_storage: 'denied',
    ad_storage: 'denied',
    ad_user_data: 'denied',
    ad_personalization: 'denied',
    wait_for_update: 500
  });
</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>

When consent is granted:

gtag('consent', 'update', {
  analytics_storage: 'granted',
  ad_storage: 'granted',
  ad_user_data: 'granted',
  ad_personalization: 'granted'
});

In GTM itself

If you’re using GTM, configure:

  • Consent Overview
  • Tag-level Consent Settings
  • Trigger tags only when required consent exists

Important notes

  • Blocking the GTM container completely means no tags in GTM can run until consent.
  • Using Consent Mode allows Google tags to load in a restricted state, which is often preferred for measurement and compliance.
  • For stricter privacy requirements, avoid loading GTM until the user opts in.

If you want, I can give you:

  1. a GTM-only setup
  2. a WordPress implementation
  3. a React / Next.js example
  4. a Cookiebot / OneTrust integration

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.