=== Lightweight Cookie Consent Banner ===
Contributors: contentpowered
Author: Content Powered
Author URI: https://www.contentpowered.com/wordpress-plugins/
Plugin URI: https://www.contentpowered.com
Tags: cookie banner, cookie consent, consent mode, gdpr, google consent mode v2
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A cookie consent banner with Google Consent Mode v2 support, without a 300KB script or a monthly fee.

== Description ==

Most cookie consent tools load a large script from someone else's server, slow down every page, and charge a monthly fee once you pass a few thousand visitors. Lightweight Cookie Consent Banner does the same job in about 8 KB, inlined in the page, with nothing loaded from anywhere else and nothing to pay.

It sets up Google Consent Mode v2 properly: every signal starts as "denied" at the very top of the page, before any Google tag runs, and is updated the moment a visitor chooses. Google Analytics, Google Ads and Tag Manager follow it however they're added to your site, and Google can model the conversions you'd otherwise lose.

= Features =

* Google Consent Mode v2, with all seven signals, including ad_user_data and ad_personalization.
* Optionally loads your Google tag (Analytics, Ads or Tag Manager) itself: right away and cookieless until consent (advanced mode), or only after consent (basic mode).
* Ask everyone, or only visitors in the EEA, the UK and Switzerland.
* Accept all, Reject all and Customize on the banner, with accept and reject equally prominent by default, as European regulators expect.
* A preferences window with Necessary, Preferences, Analytics and Marketing switches, and a small cookie button so visitors can change their mind later.
* Holds back other tracking scripts (Meta Pixel, Microsoft Clarity, Hotjar, LinkedIn and more) until their category is allowed. Paste them into the settings, or mark scripts and embeds in your theme.
* When a visitor withdraws consent, common tracking cookies are deleted and the page reloads without those scripts.
* "Ask everyone again" after you change what you use cookies for.
* Four positions (box left or right, bar, centered popup), light, dark or match the device, and your accent color. Every word can be changed, and the default wording follows your site's language.
* A live preview of the real banner on the settings page, on desktop and phone.
* Uses your theme's font but its own styles, so your theme can't break it, and it doesn't shift your layout.
* Works with page caching, and clears WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache and SiteGround caches when you save.
* Works with the WP Consent API, WPML and Polylang.
* Stores nothing about your visitors on your server.

Find it under Content Powered > Lightweight Cookie Consent Banner in the admin menu.

Found a bug or have an idea? Use Content Powered > Report a Bug or Content Powered > Submit Feedback to send it straight to us.

= Credits =

* Icons by [Lucide](https://lucide.dev), used under the ISC License. Icons derived from [Feather](https://feathericons.com) are under the MIT License. The full license text is in `icons/LICENSE`.
* Updates delivered by [Plugin Update Checker](https://github.com/YahnisElsts/plugin-update-checker) by Janis Elsts, MIT License.

== Installation ==

1. Upload the `lightweight-cookie-consent-banner` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen in WordPress. The banner appears straight away.
3. Go to Content Powered > Lightweight Cookie Consent Banner to change the wording, look and Google settings.

Updates arrive through the normal WordPress Updates screen, and you can turn on auto-updates from the Plugins screen.

== Frequently Asked Questions ==

= Does it work with Google Analytics added by Site Kit or another plugin? =

Yes. The Consent Mode defaults are printed before anything else in the page head, so any Google tag that loads after them follows them. If your theme hard-codes a Google tag above `wp_head()`, enter its ID in the plugin instead and remove it from the theme.

= What's the difference between advanced and basic mode? =

In advanced mode (Google's recommendation) the Google tag loads right away but sets no cookies until the visitor agrees, and sends cookieless pings Google uses to model conversions. In basic mode nothing from Google loads until the visitor allows analytics or marketing.

= How do I block other tracking scripts until consent? =

Paste them into the Scripts tab under Analytics, Marketing or Preferences, script tags and all. Each one runs only after the visitor allows that category. In a theme, change a script's type to `text/plain` and add `data-lccb-category="analytics"` (or marketing, or preferences).

= Can visitors change their mind? =

Yes. After choosing, a small cookie button stays in the corner and reopens the preferences. You can also add [cookie_settings_link] to your footer or privacy policy, or a menu link to #cookie-settings.

= Does it work with page caching? =

Yes. The page is the same for every visitor; the banner decides in the browser whether to show. When you save the settings, WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache and SiteGround caches are cleared for you. With any other cache, clear it after changing the settings.

= How does "Europe only" work? =

Google applies the denied defaults to visitors in the EEA, the UK and Switzerland based on their IP address. The banner itself appears for visitors whose device is set to a European time zone, which works with page caching without looking anyone up. Everyone else can still change their choice with the cookie button.

= Is it a Google-certified CMP? =

No. Google requires a certified consent platform that supports the IAB TCF for showing AdSense, Ad Manager or AdMob ads to visitors in Europe. For Google Analytics, Google Ads conversion tracking, remarketing and Tag Manager, this plugin's Consent Mode signals are what Google needs.

= Does it make my site GDPR compliant? =

It gives you the tools: nothing optional runs before consent, rejecting is as easy as accepting, and visitors can withdraw consent at any time. You still need a privacy policy that lists the cookies you use, and to put your tracking scripts where the plugin can hold them back. This isn't legal advice.

= Does it keep a consent log? =

No. The choice is stored only in the visitor's own browser, and nothing about visitors is saved on your server.

= Will other plugins follow the choice? =

Google tags from Site Kit follow the Consent Mode signals already; leave Site Kit's own Consent Mode setting off, since this plugin sends them. Plugins that read the WP Consent API, such as WooCommerce's order attribution, follow the choice once you install the free WP Consent API plugin: this plugin shares every choice with it.

== Changelog ==

See https://github.com/jmsprsns/lightweight-cookie-consent-banner/releases for the full release history.
