Guide · June 17, 2026
Consent Mode v2 for WordPress: enable and block tags before consent
Enable Consent Mode v2 for WordPress, link your consent plugin to GA4/Ads, and block tags before users consent.
Quick answer
What is Consent Mode v2 for WordPress and what is it for?
Consent Mode v2 for WordPress is a mechanism that sends consent/no-consent signals from the consent banner into GA4, Google Ads, and other measurement tags. The goal is to block activation or reduce data collection before users grant permission, instead of letting tags fire freely on page load.
For SMEs, the practical benefit is better control: the banner shows, the user’s choices are recorded, and marketing tags only operate according to the level of consent granted. This is especially useful when your site uses WooCommerce, lead forms, chat widgets, or remarketing.
What do you need before enabling Consent Mode v2 for WordPress?
You need three parts: a consent plugin on WordPress, a way to implement Google tags, and a process for storing consent evidence. If you use GTM, clearly identify which tags belong to analytics, advertising, and functional categories and are blocked by default.
If you use a plugin such as a consent banner/cookie banner, check whether the plugin supports pushing consent status to the dataLayer. In the Google ecosystem, you should map the states correctly as specified and set the default to "denied" before the user clicks agree.
Install a consent plugin:
Choose a plugin with a cookie banner, consent logging, and support for consent categories. On WordPress, prefer a plugin that can map consent to Google Tag Manager or gtag.
Set deny-by-default:
Set analytics_storage, ad_storage, and related consents to denied as soon as the page loads. This is the step that blocks tags before consent.
Connect to GA4/Ads:
If you use GTM, deploy the Google tag via GTM and configure triggers to run only when consent is granted. If you use gtag directly, enable consent updates from the plugin.
Test scenarios:
Open the site in incognito, decline all, then accept each category. Check that GA4/Ads tags only fire after consent.
Store evidence:
Record timestamp, banner version, the user’s selections, and the policy content at the moment of consent for internal reviews.
How do you connect a consent plugin to GA4 and Google Ads on WordPress?
The most common approach is via Google Tag Manager. The consent plugin pushes the user’s status into the dataLayer, and GTM uses consent conditions to decide which tags are allowed to run.
If you’re using GA4 deployed directly with gtag, make sure the consent snippet loads before the measurement tag. A good practice is: run consent defaults first, show the banner immediately, and only then allow GA4/Ads to operate when the user consents.
Real-world example: a WooCommerce shop uses a cookie banner that lets users separately choose “Analytics” and “Advertising.” When advertising is declined, GA4 can still receive limited data per the appropriate configuration; remarketing tags are held back.
How do you block tags before consent without breaking the website?
You shouldn’t block all site JavaScript. Only block the tag groups that require consent: GA4, Google Ads, Meta Pixel, TikTok Pixel, heatmaps, chat/recording if they collect personal data or track behavior.
A safe implementation is to use a control layer at the top of the page: the consent banner sets defaults, GTM loads tags based on consent, and the plugin must be able to update status when users change their mind. On WordPress, don’t forget to test cache, minify, and script defer, as they may cause tags to run in the wrong order.
| Component | Before consent | After consent | |
|---|---|---|---|
| GA4 | Held in a waiting state or runs per consent configuration | Measurement allowed per the consent granted | |
| Google Ads | Remarketing/ads tracking not activated | Activated if the user allows it | |
| Consent banner | Shown immediately on page load | Hidden after the user saves their choices | |
| Consent log | Records default status | Records timestamp, choices, banner version |
What common mistakes occur when enabling Consent Mode v2 for WordPress?
The most common mistake is installing a banner but tags still fire before consent, because GA4/Ads snippets are embedded directly in the theme or another plugin. The second is using GTM but not configuring consent defaults, causing tags to run per the container’s defaults.
Another mistake is enabling a banner without storing consent evidence. When you need an internal review or to handle complaints, you’ll lack logs. Many sites also forget to align the cookie policy with the actual tracking in use, resulting in a mismatch between the banner and the tags.
Are there any legal considerations when implementing this?
Under the Personal Data Protection Law (Law 91/2025/QH15), effective 01/01/2026, businesses must process data on the correct legal basis and meet notice and consent obligations when applicable. The enforcement authority is the Ministry of Public Security (A05).
If a data incident occurs, businesses must notify of the breach within 72 hours of discovery as required. Specific penalties will be set by the Government’s guiding decree; serious violations may be subject to criminal handling. If you use advanced trackers/analytics, review against the regulations and consult a lawyer if you’re unsure.
- Not required. You can use GTM or gtag directly, as long as the consent banner and measurement tags are wired correctly and blocked before consent.
- It depends on configuration, but the principle is to allow only to the level permitted by the chosen consent. Advertising/remarketing tags should be held back until consent.
- Recommended. Logs help prove who consented, when, and under which banner/policy version.
- If you use tracking cookies, GA4, Ads, or marketing pixels, you should still set up consent because it governs real-world data collection.
If you need help, consent.vn can standardize your cookie banner, store consent evidence, and handle DSARs right on WordPress.
Source: the Personal Data Protection Law (Law 91/2025/QH15); Decree 13/2023/ND-CP — thuvienphapluat.vn; Ministry of Public Security (A05) — bocongan.gov.vn
Get started — set up in 5 minutes.
Need help with PDPL compliance?