Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cookiechimp.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

The WP Consent API is a standard interface that WordPress plugins can read to find out whether a visitor has consented to a given category of tracking. When the integration is enabled, CookieChimp keeps the WP Consent API up to date as the user’s preferences change, so compatible plugins (Google Site Kit, WooCommerce, MonsterInsights, and many others) can react automatically.

Prerequisites

How do I enable it?

1

Open the Integrations page

Go to Integrations in your CookieChimp dashboard and find the WordPress Consent API card.Enable WordPress Integration
2

Toggle it on

CookieChimp will start writing consent state to the WP Consent API on page load and whenever the visitor updates their choices. Plugins that listen to the API will pick this up automatically.
CookieChimp CategoryWP Consent API Type
essentialfunctional
analyticsstatistics
marketingmarketing
personalizationpreferences

How do I verify it’s working?

In a PHP file or via the Query Monitor plugin, check the consent state directly:
wp_has_consent( 'statistics' ); // true if analytics is accepted
wp_has_consent( 'marketing' );  // true if marketing is accepted
Change your consent choices on the front end and refresh — the values returned by wp_has_consent() should update accordingly.
  • Enable Debug mode from the CookieChimp dashboard and check the browser JS console for errors.
If you encounter any issues or need further assistance, please reach out to us via our chat.