New Do your translations speak to AI as well as the original? · Discover
Livada.io
Docs

Livada Cookies

v1.10.7 GPL v2+

CNIL/GDPR-compliant cookie consent banner for WordPress. 11 KB gzipped. Built-in Google Consent Mode v2. Proof logs. Zero dark patterns.

1 Installation

Requirements

WordPress
6.0+
PHP
7.4+
MySQL
5.7+ / MariaDB 10.3+

Best practice before installation

As with any WordPress extension, we recommend backing up your site before installation (database + files). Reliable free backup plugins: UpdraftPlus, All-in-One WP Migration, Duplicator.

Manual installation (ZIP)

  1. 1 Download livada-cookies.zip from your Lemon Squeezy customer portal.
  2. 2 In WordPress: Plugins → Add New Plugin → Upload Plugin.
  3. 3 Select the ZIP → click Install Now → Activate Plugin.
  4. 4 On activation, the plugin automatically creates the wp_livada_consent_logs table in the database.
  5. 5 Go to Settings → Livada Cookies → License and enter your license key.
⚠️

Important — injection before GA4 / Site Kit

Livada Cookies automatically injects into wp_head with priority 1 (before all other plugins). No manual configuration needed for Google Consent Mode v2 to run ahead of GA4.

2 Configuration

All settings live under Settings → Livada Cookies. 4 tabs:

General

Banner text, Accept/Reject button text, link to the Privacy Policy. Banner position (bottom, top, modal).

Categories

Enable/disable the 4 categories (Necessary, Statistics, Marketing, Preferences). Customizable labels and descriptions.

Appearance

Color pickers for background, text, accent color. Rounded corners. Auto light/dark mode (respects prefers-color-scheme).

Advanced

Log retention period (13 months by default). CSV export of consents. Manual purge. Disable the banner on specific pages.

3 4 consent categories

Necessary

necessary Required

Always active. WordPress session, WooCommerce cart, CSRF cookie. Not subject to consent (legally exempt).

Statistics

statistics Opt-in

Google Analytics 4, Matomo, Microsoft Clarity, Hotjar. Blocked by default until the user has consented.

Marketing

marketing Opt-in

Meta Pixel, Google Ads, third-party retargeting cookies. Strictly blocked without explicit consent.

Preferences

preferences Opt-in

Personalization cookies (language, region, UI preferences). Optional depending on your stack.

4 Google Consent Mode v2

Livada Cookies automatically injects Consent Mode v2 with default parameters set to denied before any other script (priority 1 on wp_head). When the user consents, the signals are updated via gtag('consent', 'update', ...).

Category → GCM signal mapping

ad_storage → category marketing
ad_user_data → category marketing
ad_personalization → category marketing
analytics_storage → category statistics
functionality_storage → category preferences
security_storage → category necessary (always granted)
Automatic injection on wp_head (priority 1)
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)}
gtag("consent", "default", {
ad_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied",
analytics_storage: "denied",
functionality_storage: "denied",
security_storage: "granted",
wait_for_update: 500
});
</script>

5 Proof logs & CNIL compliance

Structure of the wp_livada_consent_logs table

id BIGINT AUTO_INCREMENT Unique identifier for the log entry.
consent_uid VARCHAR(36) UUID v4 generated client-side, persisted in localStorage.
action VARCHAR(20) 'accept_all', 'reject_all', 'custom', 'withdraw'
choices JSON { necessary: true, statistics: false, marketing: false, preferences: false }
ip_hash VARCHAR(64) SHA-256 of the IP (IP never stored in clear text — GDPR compliance).
user_agent_hash VARCHAR(64) SHA-256 of the user agent (never stored in clear text).
banner_version VARCHAR(10) Hash of the active banner text. Triggers re-consent if changed.
created_at DATETIME UTC timestamp of the action.

CNIL compliance — key points

✓ "Accept all" and "Reject all" buttons strictly the same visual size.
✓ No pre-checked boxes (except the legally exempt Necessary category).
✓ Non-essential scripts blocked by default before any consent.
✓ IP anonymized via SHA-256 hashing (CNIL considers the IP a personal data point).
✓ Automatic log purge beyond 13 months (CNIL recommendation).
✓ Automatic re-consent if the banner text changes (version hash).
✓ Withdrawing consent is as easy as giving it (button in the footer).

6 PHP Hooks

Actions

Fires on every consent action
// $action : "accept_all" | "reject_all" | "custom" | "withdraw"
// $choices : array{ necessary:bool, statistics:bool, marketing:bool, preferences:bool }
add_action(
'livada_cookies_consent_given',
function( $action, $choices ) {
// E.g.: trigger a custom GA4 event
if ( $choices["statistics"] ) { /* ... */ }
}, 10, 2
);

Filters

// Change the banner texts via code
add_filter( "livada_cookies_default_texts", function( $texts ) {
$texts['accept_btn'] = 'OK for me';
return $texts;
});
// Change the categories (add / rename)
add_filter( "livada_cookies_categories", function( $categories ) {
$categories['analytics']['label'] = 'Audience measurement';
return $categories;
});

7 JavaScript Events

The plugin dispatches a DOM event on every consent action.

// Listen for consent changes
document.addEventListener("lvc:consent", function(e) {
const { action, choices } = e.detail;
// action : "accept_all" | "reject_all" | "custom" | "withdraw"
// choices: { necessary: true, statistics: true, marketing: false, preferences: false }
if (choices.statistics) {
// Analytics enabled — load your custom script if needed
}
});
// Read the current consent without waiting for an event
const consent = window.LivadaCookies?.getConsent();
// → { necessary: true, statistics: false, marketing: false, preferences: false }
// Check a specific category
const hasStats = window.LivadaCookies?.hasConsent("statistics"); // true | false
// Reopen the preferences modal (e.g. a link in the footer)
window.LivadaCookies?.openPreferences();

8 Compatibility

CMS

  • ✓ WordPress 6.0+ (tested up to 6.7)
  • ✓ Multisite ✓

PHP

  • ✓ PHP 7.4, 8.0, 8.1, 8.2, 8.3

Analytics & Ads

  • ✓ Google Analytics 4 (Site Kit or direct gtag)
  • ✓ Google Ads / Floodlight
  • ✓ Meta Pixel
  • ✓ Microsoft Clarity
  • ✓ Hotjar
  • ✓ Matomo

Tag Managers

  • ✓ Google Tag Manager (Consent Mode v2)
  • ✓ Matomo Tag Manager

Multilingual

  • ✓ Polylang
  • ✓ WPML
  • ✓ TranslatePress
  • ✓ Text translated via standard .po file

Page builders & themes

  • ✓ All themes (injection on wp_head)
  • ✓ Elementor, Divi, Beaver Builder
  • ✓ Native Gutenberg

Performance

  • ✓ 11 KB gzipped (JS + CSS)
  • ✓ No render-blocking JS
  • ✓ Compatible with WP Rocket, LiteSpeed Cache
  • ✓ 0 LCP / FID impact

Accessibility

  • ✓ WCAG 2.1 AA focus trap
  • ✓ ARIA roles (dialog, radiogroup)
  • ✓ Full keyboard navigation
  • ✓ prefers-reduced-motion respected
  • ✓ Screen readers (NVDA, VoiceOver)

9 FAQ

Compatible with Google Site Kit? +

Yes. Consent Mode v2 is injected at priority 1, ahead of Site Kit. Site Kit automatically detects the consent signals and adapts GA4 accordingly. No manual configuration.

What happens if I change the banner text? +

The version hash changes. Every visitor who has already consented will see the banner reappear on their next visit. CNIL requires re-consent whenever the information changes.

How do I integrate it with my existing CMP (Axeptio, Didomi…)? +

Livada Cookies is designed to replace your existing CMP, not to run alongside it. Disable your current CMP before activating Livada Cookies.

Can I customize the colors? +

Yes. Settings → Livada Cookies → Appearance. Color pickers for background, text, accent color. Or via custom CSS targeting the .lvc-banner and .lvc-modal classes.

Are the logs GDPR-compliant? +

Yes. IP and user agent are stored hashed (SHA-256), never in clear text. Automatic purge at 13 months. The table can be deleted when the plugin is uninstalled (option under Advanced).

Does the plugin block Google Tag Manager? +

No. GTM itself is not blocked. It's the tags inside GTM that are regulated via the Consent Mode v2 signals. Your GA4 / Ads tags in GTM must be configured in "Consent required" mode.

Works with WordPress Multisite? +

Yes. Each subsite uses 1 license slot. Settings are independent per site.

Need help?

Installation, configuration, logs and compatibility: everything is detailed in this documentation.