Getting Started
Installation
Prerequisites:
WordPress 5.6+ and PHP 7.4+. Plugin is translation-ready and works out of the box with most themes.
1. Install & Activate
- Upload the
consentpress
folder to /wp-content/plugins/
.
- Activate ConsentPress from the Plugins screen.
Getting Started
Quick start
1. Basic Configuration
- Go to ConsentPress → Cookie Settings.
- Customize banner text and accent color.
- Set log retention period.
2. Define or Scan Cookies
Save definitions; they are stored in cookie-definitions.json
.
Navigate to ConsentPress → Cookie Definitions.
Click Scan Browser Cookies to auto-detect active cookies.
Edit or add definitions (type, duration, provider, purpose).
3. Display on Frontend
- Place the shortcode on your privacy or cookie policy page to show the cookie table:
[cpc_cookie_table]
4. Configure Tracking (GTM / Pixels)
- Go to ConsentPress → Pixels & GTM.
- Enter your GTM container ID and optionally Facebook / LinkedIn pixel IDs.
- Choose mode (GTM only or GTM + direct pixels).
- ConsentPress will push consent state to
dataLayer
(cpc_consent_update
) for GTM Consent Mode.
5. View & Export Logs
- Open ConsentPress → Consent Logs to see captured consent events.
- Use the Export CSV button for audits or reporting.
6. Advanced / Troubleshooting
- Enable Debug Mode under Tools to include system/internal cookies and get extended logging in the console and PHP error log.
- Use Reset Local Preferences to force the banner to reappear for testing.
Optional: External Database
To store logs in a separate database, define these constants in wp-config.php
before activation:
define('CPC_DB_HOST', 'your_host');
define('CPC_DB_NAME', 'your_database');
define('CPC_DB_USER', 'your_user');
define('CPC_DB_PASS', 'your_password');
Ready-to-Go
That’s it — ConsentPress will now show a cookie banner, respect user choices, log consent, and integrate with GTM/pixels based on consent. For full detail, see the Help & Documentation page inside the plugin.
Cookie Definitions
What are cookie definitions?
Cookie definitions describe:
- The purpose of each cookie.
- Its duration/lifespan.
- Its classification (necessary, analytics, marketing, etc.).
- How it behaves from a consent perspective.
Cookie Definitions
How do I scan for cookies?
To perform an automatic scan:
- Navigate to ConsentPress → Cookie Definitions.
- Click Scan Browser Cookies to auto-detect active cookies.
- Review detected cookies and accept or edit suggested definitions.
Displaying Consent Information
What shortcode do I use?
Use:
[cpc_cookie_table]
This will output the current cookie definitions and their consent status.
Tag Manager Integration
Setting up Consent Initialization
ConsentPress makes it easy to manage Google Tag Manager (GTM) based on user consent. Here's how to set it up properly:
Step 1: Enable GTM in ConsentPress
- Go to ConsentPress → Pixels & GTM.
- Enter your GTM Container ID (e.g. GTM-XXXXXXX).
- Select where and how GTM should load:
- Header or Body placement.
- Enable Consent-based firing (recommended).
Step 2: Configure Consent Initialization in GTM
- In your GTM workspace, go to Admin → Container Settings.
- Enable Consent Overview.
- Create the following Consent Types if not already available:
- analytics_storage
- ad_storage
- functionality_storage
- personalization_storage
- Set Default Consent State to denied.
Step 3: Add a Consent Initialization Trigger
- Create a Custom Event Trigger:
- Event Name: cpc_consent_update
- This event is dispatched by ConsentPress after user choice.
- Attach this trigger to any tags that depend on user consent.
Step 4: Update Tags to Respect Consent
For each tag (e.g., Google Analytics, Meta Pixel):
- Go to Advanced Settings → Consent Settings.
- Check "Require additional consent".
- Select relevant consent types (e.g., analytics_storage for GA4).
🧪 Testing
Use Consent Mode Debugger or GTM’s Preview mode to test consent states and tag firing.
Tag Manager Integration
Updating existing tags
Modify your tag triggers:
- Add conditions that check consent values.
- Use dataLayer variables or custom JS to reflect granted consent.
- Test in preview mode to ensure correct gating.
Consent Event Handling & Data Layer
What does the app push to the dataLayer?
It pushes structured events such as cpc_consent_update
that include:
- Consent categories and their states.
- Versioning or change metadata.
- Timestamp of update.
Consent Event Handling & Data Layer
Structure of the consent update object
The object contains key/value pairs for each consent type, for example:
analytics_storage: granted/denied
ad_storage: granted/denied
- Additional metadata like
version
and timestamp
.
Testing & Debugging
Enabling debug mode
Turn on debug mode from the plugin interface to receive:
- Verbose console output.
- Server-side log details.
- Consent decision traces.