Documentation Getting Started
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.

Documentation Cookie Definitions
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:

  1. Navigate to ConsentPress → Cookie Definitions.
  2. Click Scan Browser Cookies to auto-detect active cookies.
  3. Review detected cookies and accept or edit suggested definitions.

Cookie Definitions

How do I manually define or edit a cookie?

Follow these steps:

  • Click “Add New” or select an existing definition.
  • Provide name, purpose, category, and duration.
  • Save the definition and verify it appears in the list.

Documentation Displaying Consent Information
Displaying Consent Information

How do I embed the cookie table?

To embed the table:

  1. Open the page where you want the table (e.g., Privacy Policy).
  2. Insert the shortcode [cpc_cookie_table] into the content editor.
  3. Publish or update the page.
  4. Verify the table renders and reflects current definitions.

Displaying Consent Information

What shortcode do I use?

Use:

[cpc_cookie_table]

This will output the current cookie definitions and their consent status.

Displaying Consent Information

Best Placement Practices

Recommended locations:

  • Privacy Policy page.
  • Dedicated “Cookie Information” or compliance page.
  • Footer link accessible from every page.

Documentation Tag Manager Integration
Tag Manager Integration

What consent types matter?

Tags should check for:

  • analytics_storage
  • ad_storage
  • functionality_storage
  • personalization_storage

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

  1. Go to ConsentPress → Pixels & GTM.
  2. Enter your GTM Container ID (e.g. GTM-XXXXXXX).
  3. Select where and how GTM should load:

    • Header or Body placement.
    • Enable Consent-based firing (recommended).

Step 2: Configure Consent Initialization in GTM

  1. In your GTM workspace, go to Admin → Container Settings.
  2. Enable Consent Overview.
  3. Create the following Consent Types if not already available:

    • analytics_storage
    • ad_storage
    • functionality_storage
    • personalization_storage

  4. Set Default Consent State to denied.

Step 3: Add a Consent Initialization Trigger

  1. Create a Custom Event Trigger:

    • Event Name: cpc_consent_update
    • This event is dispatched by ConsentPress after user choice.

  2. 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.

Documentation Consent Event Handling & Data Layer
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.

Consent Event Handling & Data Layer

Using it in triggers

To leverage it:

  1. Create triggers referencing the appropriate dataLayer variables.
  2. Condition tag firing on granted consent.
  3. Fallback gracefully when consent is missing or denied.

Documentation Testing & Debugging
Testing & Debugging

How do I test if tags respect consent?

Recommended approach:

  1. Open GTM preview mode.
  2. Simulate granting/denying different consent types.
  3. Watch which tags fire in each state.

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.

Testing & Debugging

Reading outputs and logs

Look for:

  • Mismatch between expected consent in dataLayer and actual tag firing.
  • Errors or warnings in browser console.
  • Backend log entries if consent processing failed.