Services

We build
high-quality websites
.

We are experts in creating websites that resonate with and convert

Let's work together!

Get a free consultation with our experts

Why us?

Behind every great website is a
great team
.

We have built 150+ websites for marketers and global brands.

Services

Services

We build
high-quality websites
.

We are experts in creating websites that resonate with and convert

Let's work together!

Get a free consultation with our experts

About us

Why us?

Behind every great website is a
great team
.

We have built 150+ websites for marketers and global brands.

Insights

How to Properly Set Up Consent Mode in the WebToffee GDPR Cookie Consent Plugin

Table of Contents

Learn how to properly configure WebToffee Consent Mode with Google Tag Manager, GA4, and Microsoft Clarity for GDPR-compliant tracking.

The most effective way to implement Consent Mode on a WordPress website is to use a single instance of Google Tag Manager and deploy all tracking and marketing services through it.

This includes services that natively support Consent Mode, such as:

  • Google Analytics 4
  • Google Ads
  • Microsoft Clarity

This approach keeps your consent management centralized, scalable, and compliant with GDPR requirements.

WebToffee GDPR Cookie Consent Plugin Setup

Enable Google Consent Mode

Once your plugin is installed and configured, navigate to:

WordPress Admin → Cookie Consent → Google Consent Mode (GCM)

Enable the following options:

  • Enable Google Consent Mode
  • Manage Consent Mode with GTM Template

The second option is essential because it allows the plugin to communicate consent states directly with Google Tag Manager.

Configure Microsoft Clarity Consent Mode

If you are using Microsoft Clarity, you can also integrate it with Consent Mode.

Go to:

Cookie Consent → Microsoft Consent Mode

Enable:

  • Microsoft Clarity Consent Mode
  • Support Microsoft UET Consent Mode (if you are using Microsoft Advertising)

This ensures Microsoft tracking respects user consent preferences.

Google Tag Manager Setup

After finishing the plugin configuration, Google Tag Manager will load on every page regardless of whether cookies have been accepted.

This behavior is correct and expected.

The next step is to install the WebToffee CMP template inside GTM and properly configure your triggers and tags.

Install the WebToffee CMP Template in GTM

Go to:

Google Tag Manager → Tags → New → Tag Configuration → Discover more tag types in the Community Template Gallery

Search for:

WebToffee CMP

Add the template to your workspace.

Create a new tag with:

Tag Name: WebToffee CMP
Trigger: Page View – All Pages
In most cases, the Page View trigger is already available by default.

Configure Services That Support Consent Mode

Services such as:

  • Google Analytics 4
  • Google Ads
  • Microsoft Clarity

can safely fire on the default:

Page View – All Pages trigger.

These platforms are capable of operating in a limited, anonymous mode before consent is granted. Once the visitor accepts cookies, the services automatically switch to full tracking functionality.

This means:

  • GTM loads immediately
  • Consent-aware tags load immediately
  • Cookies are only stored after user consent is granted

This setup is compliant when configured correctly.

Configure Services and Tags That Require Cookies

This is the most important part of your GDPR compliance setup.

Any tag or third-party service that relies on cookies should only fire after the appropriate consent category has been granted by the user.

Examples include:

  • Retargeting scripts
  • Heatmaps
  • Marketing pixels
  • Affiliate tracking
  • Third-party analytics tools

Create a Consent Variable in Google Tag Manager

You can use the consent state available in the Google Tag Manager Data Layer to control when specific tags are triggered.

For example, if a tag should only fire after Analytics Cookies are accepted, you first need to create a Data Layer Variable.

Go to:

Variables → New → Data Layer Variable

Use the following configuration:

Data Layer Variable Name: analytics_storage

You can verify this value inside Tag Assistant under the Data Layer tab.

Create a Custom Event Trigger

Next, create a trigger that listens for consent updates from the WebToffee plugin.

Use the following configuration:

Event Name: wcc_gcm_consent_update
Enable: Use regex matching

Enabling regex matching ensures the trigger fires in both situations:

  • When consent changes dynamically without a page reload
  • When the page is reloaded

Under:

This trigger fires on → Some Custom Events

Set the condition:

Analytics Consent equals granted

This trigger can now be assigned to any tag that should only activate after analytics consent is approved.

Repeat the same logic for other consent categories such as:

  • Marketing
  • Preferences
  • Functional cookies

This creates a fully scalable and compliant consent setup inside GTM.

Testing Your Consent Mode Configuration

After configuration is complete, thoroughly test the implementation.

Test in GTM Preview Mode

Open:

Google Tag Manager → Preview

This launches Tag Assistant.

Verify that:

  • Cookie-dependent tags only fire after the relevant consent category is granted
  • Google Analytics 4 fires immediately on Page View
  • Microsoft Clarity fires immediately on Page View

Verify Cookies in the Browser

For final validation:

  1. Open your website in Google Chrome
  2. Open Developer Tools
  3. Navigate to:
    Inspect → Application → Cookies
  4. Clear all existing cookies
  5. Reload the page

Before consent is granted, only essential cookies should appear.

After accepting cookies, the corresponding tracking and marketing cookies should become visible.

Final Recommendation

Once everything is working correctly, run a complete cookie scan of your website to ensure all cookies are properly categorized and blocked before consent.

A properly configured Consent Mode implementation improves:

  • GDPR compliance
  • Data accuracy
  • Tag management scalability
  • Website performance
  • Marketing attribution quality
Picture of Roman Vlčák

Roman Vlčák

An incorrigible perfectionist passionate about pixel-perfect work, who constantly strives to deliver the highest possible quality. Outside of Webgate, he is a caring husband and father to his young son. In his free time, he likes traveling with his family and doing puzzles.

Senior WordPress Developer • Co-founder

Share this artcle

Let's work together!

Get a free consultation with our experts

Subscribe to our quarterly newsletter and receive latest insights.

Topics: Improving B2B websites, AI tools in web development, UX/UI, website marketing trends etc.

By submitting this form you agree to the processing of your personal data according to our .

Contact

Let's work together!

Get a free consulting call with our experts

Book a call with
Webgate founders

Thank you for your interest!

We will contact you soon.