automattic / jetpack-cookie-consent
GDPR cookie-consent banner, CCPA opt-out, and consent logging for WordPress.
Package info
github.com/Automattic/jetpack-cookie-consent
Type:jetpack-library
pkg:composer/automattic/jetpack-cookie-consent
Requires
- php: >=7.2
This package is auto-updated.
Last update: 2026-06-18 09:47:27 UTC
README
Cookie Consent (@automattic/jetpack-cookie-consent) is a plugin-agnostic package intended to provide a GDPR cookie-consent banner, a CCPA "Do Not Sell/Share" opt-out flow, geolocation-based consent-model selection, WP Consent API integration, and consent logging.
This package is currently scaffold-only (no runtime behavior yet) and includes a placeholder Interactivity module entry point so the build passes; feature code is introduced in follow-up PRs.
Usage
\Automattic\Jetpack\CookieConsent\Cookie_Consent::init();
Build the frontend module before use:
pnpm --filter @automattic/jetpack-cookie-consent build
Configuration
Filter jetpack_cookie_consent_config to override defaults (geo API URL, GDPR/CCPA region lists, cookie policy URL, and the Tracks event_prefix). The Tracks event prefix defaults to jetpack; set it to woocommerceanalytics to keep continuity with the WooCommerce/Unified Analytics Tracks stream.
Requirements
- PHP >= 7.2
- The WordPress Interactivity API (WP 6.5+ / Gutenberg).
- The WP Consent API plugin (provides
window.wp_set_consent) for writing consent state.