Disgrifiad
VGDev Cookie Banner for Consent Mode v2 is a lightweight, self-hosted GDPR cookie consent solution that integrates natively with Google Consent Mode v2, Google Tag Manager (GTM) and Google Analytics 4 (GA4).
All consent signals start as denied and are updated in real time based on the visitor’s choices — fully compliant with Google’s requirements for EU markets.
Key Features
- ✅ Google Consent Mode v2 — all 7 consent signals managed automatically
- ✅ Google Tag Manager (GTM) — head snippet + body noscript injected automatically
- ✅ Google Analytics 4 (GA4) — standalone gtag.js support (when GTM is not used)
- ✅ GDPR Compliant — consent defaults to denied before any tracking occurs
- ✅ Multilingual Privacy Policy — set a different privacy policy URL per language
- ✅ 29 built-in languages — auto-detected via WPML, Polylang or WordPress locale
- ✅ Performance Mode — lazy loads the banner after user interaction (boosts PageSpeed score)
- ✅ Force Consent — block the page until the user makes a choice
- ✅ Fully customizable — colors, layout, position, floating button, and more
- ✅ Self-hosted — no external consent management platform needed
- ✅ Lightweight — no jQuery dependency for the front-end script
Google Consent Mode v2 Signals
The plugin manages all required consent signals:
ad_storagead_user_dataad_personalizationanalytics_storagefunctionality_storagepersonalization_storagesecurity_storage
Consent Categories
- Necessary
security_storage - Functionality
functionality_storage,personalization_storage,security_storage - Analytics
analytics_storage,security_storage - Marketing
ad_storage,ad_user_data,ad_personalization,personalization_storage
Multilingual Support
Works out of the box with WPML, Polylang and WordPress locale. You can also set per-language privacy policy URLs so visitors always see the privacy page in their own language.
Performance Mode
Enable lazy loading to load the cookie banner only after the first user interaction (scroll, click, mouse move or touch). Since Google PageSpeed Insights does not simulate interactions, the banner will not appear in the performance audit — significantly improving your Core Web Vitals score.
Built-in Languages
English, Greek, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Slovak, Hungarian, Romanian, Bulgarian, Croatian, Serbian, Slovenian, Estonian, Latvian, Lithuanian, Finnish, Swedish, Danish, Norwegian, Russian, Ukrainian, Chinese, Japanese, Arabic.
External Services
This plugin connects to external services provided by Google when the site administrator configures a Google Tag Manager (GTM) Container ID or a Google Analytics 4 (GA4) Measurement ID in the plugin settings.
Google Tag Manager (GTM)
When a GTM Container ID is entered in the plugin settings, the plugin loads the Google Tag Manager JavaScript snippet from Google’s servers. This happens on every front-end page load.
- What it does: Loads the GTM container script so that tags configured inside GTM (analytics, advertising, etc.) can fire according to consent status.
- What data is sent: The GTM Container ID and standard browser information (IP address, user agent, page URL, referrer) are sent to Google’s servers when the script is loaded. Additional data may be collected depending on the tags configured within GTM by the site administrator.
- When it is sent: On every front-end page load, after the consent defaults have been set.
- Service provider: Google LLC
- Terms of Service: https://www.google.com/analytics/terms/tag-manager/
- Privacy Policy: https://policies.google.com/privacy
Google Analytics 4 (GA4) via gtag.js
When a GA4 Measurement ID is entered and no GTM Container ID is configured, the plugin loads the Google Analytics gtag.js script from Google’s servers.
- What it does: Loads the GA4 measurement script to collect website analytics data (page views, events, etc.) according to consent status.
- What data is sent: The GA4 Measurement ID and standard browser information (IP address, user agent, page URL, referrer) are sent to Google’s servers. Analytics data (page views, session data, events) is only collected according to the visitor’s consent choices.
- When it is sent: On every front-end page load, after the consent defaults have been set. Actual analytics data collection depends on user consent.
- Service provider: Google LLC
- Terms of Service: https://marketingplatform.google.com/about/analytics/terms/us/
- Privacy Policy: https://policies.google.com/privacy
Note: No data is sent to any external service by this plugin unless the site administrator explicitly configures a GTM Container ID or GA4 Measurement ID. The cookie consent preferences are stored locally in the visitor’s browser and are not transmitted to any external server.
Gosod
- Upload the
vgdev-cookie-banner-consent-mode-v2folder to/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Go to Settings Consent Mode to configure your options
- Enter your GTM Container ID or GA4 Measurement ID
- Customize the banner appearance and behavior
Cwestiynau Cyffredin
-
Do I need Google Tag Manager?
-
No. You can use it standalone with a GA4 Measurement ID. If you configure GTM, GA4 is managed from within GTM and the standalone GA4 field is ignored.
-
Does this work with WPML or Polylang?
-
Yes. The banner language is automatically detected. You can also set per-language privacy policy URLs.
-
Will this break my PageSpeed score?
-
No. Enable Performance Mode in General Settings to lazy-load the banner after user interaction, keeping your PageSpeed score high.
-
Is this compliant with Google’s EU User Consent Policy?
-
Yes. The plugin implements Google Consent Mode v2 with all required signals defaulting to
deniedbefore any user interaction.
Adolygiadau
There are no reviews for this plugin.
Contributors & Developers
“VGDev Cookie Banner for Consent Mode v2” is open source software. The following people have contributed to this plugin.
CyfranwyrTranslate “VGDev Cookie Banner for Consent Mode v2” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Cofnod Newid
1.0.0
- Initial release
- Google Consent Mode v2 with all 7 signals
- Google Tag Manager integration (head + body noscript)
- Google Analytics 4 standalone support
- 29 built-in languages
- Multilingual privacy policy URLs (per language)
- Performance Mode (lazy load on user interaction)
- Force Consent mode
- Fully customizable banner, buttons, floating button
- Color picker for all UI elements
