consent mode v2 wordpress plugin: setup and configuration

Your WordPress site needs a consent mode v2 plugin to stay compliant. This guide covers the best options, how to install them, and how to verify the setup works.

Eptekhar Hasan8 min read
Illustration for consent mode v2 wordpress plugin: setup and configuration

A consent mode v2 wordpress plugin is a tool that tells Google Analytics and Google Ads whether a visitor has agreed to be tracked. Without it, your site may violate privacy laws or lose conversion data. This article explains how to choose the right plugin, install it, and confirm the signals are firing correctly. You will learn the specific steps to connect your cookie banner to Google’s consent API.

You are asking this because you know Google requires consent signals for visitors in the European Economic Area. Since March 2024, this requirement is mandatory for anyone running Google Ads. Even if you do not run ads, Google Analytics 4 uses these signals to model data for visitors who decline cookies. Without the signals, your reports show gaps. You cannot fill those gaps with a workaround. The plugin bridges the gap between your cookie banner and Google’s servers. It sends the granted or denied status before any tracking cookies are set.

Step 1: Choose the right plugin

The WordPress ecosystem offers several options. You need one that explicitly supports the WP Consent API. This API is the standard way plugins communicate consent status to each other. If your banner plugin does not use this API, it will not talk to your analytics plugin.

Here are three reliable options based on their integration capabilities:

  • WPConsent: This is a free plugin that handles the banner and the consent signals. It has a specific toggle for Google Consent Mode v2. It works out of the box with major analytics plugins like MonsterInsights and Site Kit.
  • Simple Consent Mode: This is a lightweight plugin that focuses purely on the technical integration. It does not provide a banner. You need a separate banner plugin. It automatically configures the consent state for Google Tag Manager.
  • CookiePile: This plugin emphasizes prior blocking. It blocks scripts until consent is given. It includes diagnostics to check if everything is working. It requires a free account to use.

If you already have a banner plugin, check its settings. Many modern plugins, such as Complianz or CookieYes, have built-in Consent Mode v2 support. If they do, you may not need a second plugin. Check the settings page of your current banner for a toggle labeled "Google Consent Mode" or "Consent API".

Step 2: Install and activate the plugin

Once you have chosen your plugin, the installation process is standard for WordPress.

  1. Log in to your WordPress admin dashboard.
  2. Navigate to the "Plugins" menu and click "Add New".
  3. Search for the name of your chosen plugin in the search bar.
  4. Click the "Install Now" button.
  5. Wait for the installation to complete, then click "Activate".

If you are using Simple Consent Mode, you will see a new menu item in your admin sidebar called "Simple Consent Mode". If you are using WPConsent, you will see a menu item called "WPConsent".

For Simple Consent Mode, you can also install it via FTP. Upload the simple-consent-mode folder to the /wp-content/plugins/ directory. Then activate it through the Plugins menu. This method is useful if you prefer managing files directly on your server.

This is the critical step. Installing the plugin is not enough. You must ensure it is sending the correct signals to Google.

If you are using WPConsent:

  1. Go to "WPConsent" > "Settings" in your admin dashboard.
  2. Look for the "Cookie Configuration" section.
  3. Find the toggle for "Google Consent Mode".
  4. Ensure this toggle is switched on. It is often on by default, but you must verify it.
  5. Save your changes.

WPConsent connects to the WP Consent API. This means it tells other plugins, like MonsterInsights or Site Kit, what the visitor has chosen. You do not need to write code for this. The plugin handles the communication automatically.

If you are using Simple Consent Mode:

  1. Go to the "Simple Consent Mode" menu in your admin dashboard.
  2. The plugin automatically configures the consent mode for Google Tag Manager.
  3. You can adjust which specific cookie types are tracked. For example, you can allow analytics but block marketing.
  4. No complex manual setup is required. The plugin dynamically adjusts tag behavior based on user choice.

If you are using a different plugin, look for a section labeled "Integrations" or "Advanced Settings". Enable the option for Google Consent Mode v2. Some plugins require you to enter your Google Tag Manager container ID. If so, paste the ID from your Google Tag Manager account.

Step 4: Verify the setup is working

You cannot trust that the setup is working just because you turned on a toggle. You must verify that the signals are being sent.

First, check if the plugin is actually installed and active. You can use a free checker to see if Consent Mode v2 is enabled on your site. This checker tells you whether the consent signals are present in your page source. Visit the consent mode checker and enter your website URL. It scans your site and reports if the gtag('consent', 'default', ...) commands are present.

Next, open your browser’s developer tools. Press F12 or right-click and select "Inspect". Go to the "Console" tab. Clear the console. Then reload your page.

Look for lines that start with gtag('consent'. You should see commands like:

gtag('consent', 'default', {
  'analytics_storage': 'denied',
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied'
});

If you see these commands with "denied" values, the plugin is working. It is telling Google to wait for consent.

Next, click "Accept" on your cookie banner. Clear the console again and reload the page. You should now see:

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

If you do not see these commands, the plugin is not connected to your analytics setup correctly. Check your settings again. Ensure your analytics plugin is installed and activated.

Common mistakes to avoid

Many site owners make the same errors when setting up a consent mode v2 wordpress plugin.

Using an outdated plugin. Some older cookie banner plugins do not support the WP Consent API. They may send a signal, but it might not reach Google Tag Manager. Check the plugin’s documentation for "Consent Mode v2" support. If it is not listed, the plugin is likely too old.

Forgetting to save settings. After enabling the toggle, you must click "Save Changes". A toggle that is on in the UI but not saved in the database does nothing.

Confusing Consent Mode with a banner. Consent Mode is the signal. The banner is the interface. You need both. A banner without Consent Mode does not stop tracking scripts from loading. Consent Mode without a banner does not ask for permission.

Not testing on a clean browser. Use an incognito window or a private browsing session to test. Your local browser may have cached consent from a previous visit. This can make it look like the setup is working when it is not.

How to handle Google Tag Manager

If you use Google Tag Manager, the integration is slightly different. You need to ensure your GTM container is configured to respect consent.

  1. Log in to your Google Tag Manager account.
  2. Go to "Admin" > "Tags".
  3. Check your Google Analytics 4 Configuration Tag.
  4. Ensure the "Consent Mode" option is enabled in the tag settings.
  5. Save and publish your container.

If you are using Simple Consent Mode, the plugin handles this for you. It automatically adjusts the behavior of your tags. You do not need to manually adjust code in GTM.

If you are using WPConsent, you need to ensure your analytics plugin is connected to GTM. If you use Site Kit, it manages this connection for you. If you use MonsterInsights, it also handles the connection.

Troubleshooting issues

If your setup is not working, follow these steps.

  1. Check the plugin list. Ensure no other plugin is conflicting. Deactivate all plugins except your banner and analytics plugins. Test again. If it works, reactivate plugins one by one to find the conflict.
  2. Check your JavaScript console. Look for errors. If you see a red error message, click it to see the details. It may point to a missing script or a syntax error.
  3. Verify your Google ID. Ensure your Google Analytics ID or GTM ID is correct in your plugin settings. A typo in the ID will prevent the signal from reaching Google.
  4. Clear your cache. If you use a caching plugin, clear the cache after making changes. Old cached pages may not reflect the new consent settings.

If you are still stuck, consider using a different plugin. Some plugins have better documentation or support. Switching is easier than debugging a broken setup.

When to seek professional help

If you run a high-traffic site or handle sensitive data, you may need a more robust solution. A basic plugin may not cover all your compliance needs. You might need server-side tracking to reduce client-side dependency.

If you are struggling with the setup or want to ensure your tracking is fully compliant, you can look into server-side tracking services. This approach moves the consent logic to your server, which can be more reliable and faster. It also helps with privacy by sending fewer requests from the user’s browser.

For more tips on WordPress compliance, read our guide on cookie consent best practices. It covers the legal requirements and how to document your consent.

Final checklist

Before you consider the job done, run through this list:

  • Plugin installed and activated.
  • Consent Mode v2 toggle enabled in plugin settings.
  • Analytics plugin installed and connected.
  • Google Tag Manager container published (if used).
  • Browser console shows gtag('consent', 'default', ...) commands.
  • Clicking "Accept" changes commands to granted.
  • No JavaScript errors in the console.
  • Cache cleared.

If you can check all these boxes, your consent mode v2 wordpress plugin is working. Your site is sending the correct signals to Google. You are compliant with the requirement.

Remember, compliance is not a one-time task. Update your plugins regularly. Google changes its requirements. New plugins are released. Keep your setup current.

For more resources on tracking and automation, visit our pricing page to see how we can help you build robust systems. You can also check out our work portfolio to see examples of tracking setups we have built for small businesses.

If you have questions, you can contact us for a free consultation. We can review your site and ensure your tracking is set up correctly.

Keep reading

All guides