=== BusinessConsent Cookie Consent with Google Consent Mode ===
Contributors: businessconsent
Tags: cookie banner, cookie consent, gdpr, consent mode, ccpa
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie banner for GDPR, UK GDPR and US privacy laws, with Google Consent Mode v2 and automatic blocking of known trackers.

== Description ==

BusinessConsent adds a consent banner to your WordPress site and keeps tracking off until visitors agree.

* **Banner for each visitor's location** – opt-in for visitors from the EU, the UK and similar regions, and an opt-out "Your Privacy Choices" link for US states that use opt-out, with Global Privacy Control respected.
* **Google Consent Mode v2 built in** – Google Analytics, Google Ads and Tag Manager start in "denied" mode and follow each visitor's choice.
* **Automatic blocking** – the Meta Pixel, TikTok, LinkedIn, Pinterest, Microsoft Clarity, Hotjar, HubSpot and other known trackers wait until the visitor agrees, without editing your theme.
* **Proof of consent** – every decision is recorded with a signed receipt in your dashboard.
* **WP Consent API support** – plugins that read the WP Consent API (such as WooCommerce and Site Kit) see the visitor's choice.
* **Works with caching and optimisation plugins** – the banner script is excluded from deferring and delaying in WP Rocket, Autoptimize, LiteSpeed Cache, Cloudflare Rocket Loader and others.

You design the banner, choose languages and run compliance checks in the BusinessConsent dashboard. This plugin connects your site to it.

A BusinessConsent account is required. A free plan is available.

= Trademarks =

Google, Google Analytics, Google Ads, Google Tag Manager and Google Consent Mode are trademarks of Google LLC. Meta, TikTok, LinkedIn, Pinterest, Microsoft Clarity, Hotjar, HubSpot, WooCommerce, Site Kit, WP Rocket, Autoptimize, LiteSpeed Cache and Cloudflare are trademarks of their respective owners. They are named only to describe what this plugin works with; BusinessConsent is not affiliated with, endorsed or sponsored by any of them.

== External services ==

This plugin connects your site to the BusinessConsent service, which provides the cookie banner. Nothing is sent until you enter a property ID and switch the banner on in Settings → BusinessConsent.

When the banner is on, each visitor's browser:

* loads the banner script from `https://cdn.businessconsent.com/v1/{property ID}` on every page;
* loads the banner settings for your property from `https://api.businessconsent.com/v1/config/{property ID}`, and asks `https://api.businessconsent.com/v1/geo` for the visitor's region so the right rules apply;
* when the visitor makes a choice, sends a consent record to `https://api.businessconsent.com/v1/consent`: your property ID, a random visitor ID stored in the browser, the choices for each category, how the choice was made, whether Global Privacy Control was on, the banner and policy versions, the language and the time;
* if the banner script itself fails, may send an error report (error message and stack trace, no page address) to `https://api.businessconsent.com/v1/errors/client`.

As with any web request, these services also receive the visitor's IP address and browser user agent.

The service is provided by BusinessConsent: [Terms of Service](https://businessconsent.com/terms), [Privacy Policy](https://businessconsent.com/privacy), [Data Processing Agreement](https://businessconsent.com/dpa).

== Installation ==

1. Install and activate the plugin.
2. Create a free account at [app.businessconsent.com](https://app.businessconsent.com/sign-up) and add your website as a property.
3. Copy the property ID from Properties → your website → Install.
4. In WordPress, go to Settings → BusinessConsent, paste the property ID, tick "Show the BusinessConsent banner on this site" and save.
5. Back in the dashboard, use "Check installation" to confirm everything works.

If your theme or another plugin already adds the BusinessConsent script, remove it so the banner loads only once.

== Frequently Asked Questions ==

= Do I need to change my theme or tracking code? =

No. The plugin adds the banner script as the first script on every page. Google tags keep working in Consent Mode, and the known trackers listed above are held until the visitor agrees.

= My caching plugin delays JavaScript. Will the banner still work? =

Yes. The plugin asks WP Rocket and Autoptimize to leave the banner script alone, and marks it so LiteSpeed Cache, Cloudflare Rocket Loader and similar tools don't defer it. If you use another optimisation tool, exclude `cdn.businessconsent.com` from its "delay" or "defer" JavaScript settings.

= Can I hold a script that isn't blocked automatically? =

Yes. Change its type and name its category: `<script type="text/plain" data-cmp-category="statistics" src="…"></script>`. Categories are `preferences`, `statistics` and `marketing`.

= Where are the banner's texts, colours and languages set? =

In the BusinessConsent dashboard, so you can change them without touching WordPress.

== Changelog ==

= 1.0.0 =
* First release: settings page, banner script added first in the page head, optimisation-plugin exclusions and WP Consent API support.
