=== Velo Consent ===
Contributors: veloconsent
Tags: cookie banner, cookie consent, gdpr, consent mode, ccpa
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie banner with Google Consent Mode v2, GDPR, CCPA and GPC rules by visitor country. Works with WooCommerce and Site Kit via WP Consent API.

== Description ==

Velo Consent adds a cookie consent banner to your WordPress site and sends Google Consent Mode v2 signals before your analytics and advertising tags run. Connect it to your Velo account in one click and the banner, regional rules and consent records are handled for you.

= Why Velo Consent =

* **Google Consent Mode v2 (advanced).** Defaults are set before any tag loads, so Google can model the conversions of visitors who decline.
* **The right rules for each visitor.** Opt-in banners for the EU, UK and Brazil, opt-out with "Do not sell or share" for US states, and Global Privacy Control honoured.
* **Works with your other plugins.** Through the [WP Consent API](https://wordpress.org/plugins/wp-consent-api/), WooCommerce, Site Kit by Google, WP Statistics and other compliant plugins follow each visitor's choice.
* **Meta and Microsoft Ads signals.** Consent is passed to the Meta pixel and Microsoft UET as well as Google tags.
* **Consent records.** Every choice is logged with a receipt, with a dashboard and CSV export in the Velo console.
* **Cookie scanning.** Velo scans your site, suggests a category for each cookie and shows which tags load before and after consent.
* **Your language, your look.** The banner shows in the visitor's language (14 languages), with your own text and colours.
* **Light.** One small script, loaded async from a global CDN. No database tables, no settings to keep updated in WordPress.

= Free plan =

The free plan covers one site and up to 1,500 sessions a month, with Consent Mode v2, regional rules, consent records and a monthly cookie scan. Pro starts at 7 EUR a month for more traffic, unlimited sites, your own logo and no Velo badge. See [pricing](https://veloconsent.com/pricing).

= How it works =

1. Install and activate the plugin.
2. Go to **Settings > Velo Consent** and click **Connect to Velo**. Sign in or create a free account, and your site is linked.
3. Your banner is live. Change its text, colours and regional rules in the Velo console.

The plugin prints the Velo script at the very top of your site's head, so consent defaults are in place before any other tag. It also warns you if another cookie banner plugin is active, because two banners confuse visitors and send Google conflicting signals.

= External services =

This plugin connects to Velo, a consent management service operated by Amplio Data. No requests are made from PHP on your server; all communication happens in the browser.

1. **Velo CDN (`cdn.veloconsent.com`)**
   * **What it is used for:** Loads the Velo banner script (`https://cdn.veloconsent.com/v1/velo.js`) on every front-end page once a site ID is set.
   * **What data is sent and when:** When a visitor loads a front-end page, their browser requests the script from `cdn.veloconsent.com`. As with any HTTPS request, the visitor's IP address and standard HTTP request headers are received by the CDN.
   * **Privacy policy and terms:** Processed under the [Velo Privacy Notice](https://veloconsent.com/privacy) and [Terms of Service](https://veloconsent.com/terms).

2. **Velo Application and API (`app.veloconsent.com`)**
   * **What it is used for:** Handles the admin connect flow (`https://app.veloconsent.com/connect`), delivers the site's banner configuration and regional consent rules to the browser, and stores anonymous consent records when a visitor makes a choice.
   * **What data is sent and when:**
     * When an administrator clicks **Connect to Velo** in **Settings > Velo Consent**, their browser opens `app.veloconsent.com/connect` with the site URL, site name, return URL and a one-time state token.
     * When a visitor loads a front-end page, the browser script requests regional policy and banner settings from `app.veloconsent.com`, and sends the visitor's consent choice, page URL, banner language, anonymous subject identifier and IP address (used for country lookup) when a choice is recorded.
   * **Privacy policy and terms:** Processed under the [Velo Privacy Notice](https://veloconsent.com/privacy) and [Terms of Service](https://veloconsent.com/terms).

== Installation ==

1. Install and activate **Velo Consent** from the WordPress plugins screen, or upload the `velo-consent` folder to `/wp-content/plugins/`.
2. In your WordPress admin, open **Settings > Velo Consent**.
3. Click **Connect to Velo** to link your site, or open **Enter a site ID manually**, paste your site ID and click **Save**.

== Frequently Asked Questions ==

= Do I need a Velo account? =

Yes. You need a Velo account to configure your banner and view consent records. A free plan is available at [veloconsent.com](https://veloconsent.com/).

= Does it work with WooCommerce and Site Kit? =

Yes. Velo Consent integrates with the [WP Consent API](https://wordpress.org/plugins/wp-consent-api/) plugin. When WP Consent API is active, Velo Consent sets the visitor's regional consent type (`optin` or `optout`) and maps each consent choice to the WP Consent API categories (`functional`, `preferences`, `statistics`, `statistics-anonymous` and `marketing`), so WooCommerce, Site Kit and other compliant plugins follow the visitor's decision.

= Is it GDPR and CCPA compliant? =

Velo applies the rules for each visitor's country: prior consent in the EU, UK and other opt-in regions, and opt-out with "Do not sell or share my personal information" in US states that require it. Every choice is recorded so you can show it later. Compliance also depends on how your site uses data, so check your own obligations.

= Can I use it with Google Tag Manager? =

Yes. If you already run a Tag Manager container you can use the Velo template from the Tag Manager Community Template Gallery instead of this plugin. Use one or the other, not both.

= I already use Complianz, CookieYes or Cookie Notice. =

Deactivate the other consent plugin before Velo goes live. The settings page warns you if one is still active.

= I use a caching plugin. Do I need to do anything after connecting? =

Yes. Clear your page cache and any CDN cache after connecting or disconnecting your site so cached pages include the updated header script.

== Screenshots ==

1. The Velo banner on a WordPress site: equal Reject and Accept, and a link to choose each category.
2. Settings > Velo Consent before connecting: one button links the site to your Velo account.
3. Once connected: the status check confirms the banner script, the WP Consent API bridge and that no other consent plugin is active.

== Changelog ==

= 0.1.0 =
* Initial release.
* Early `wp_head` script output with `data-api`, `data-velo-site` and `async`.
* Admin settings page with one-click Velo console connect flow, manual site ID entry and status checklist.
* WP Consent API registration and client-side consent category bridge.
