DEV Community

IntelligenceX
IntelligenceX

Posted on

Cookie Consent Integration for WordPress, Webflow and Custom Websites: A Developer's Guide

A startup can build its marketing website using WordPress, launch landing pages through Webflow and develop its actual product using React or Next.js.

The consent implementation across these environments will not necessarily be the same.

A WordPress plugin may handle installation automatically. Webflow may require a marketplace app or an embedded script. A custom frontend may need JavaScript initialisation and explicit control over tag execution.

Let's look at how developers should evaluate cookie consent implementations across these three environments.

1. Understand the implementation requirements

A working CMP integration should address:

  • Consent interface.
  • Purpose-based preferences.
  • Consent state management.
  • Configured script blocking.
  • Consent withdrawal.
  • Regional configuration.
  • Evidence and record management.

The critical engineering requirement is timing.

If a tracking script runs before the consent mechanism has been initialised, showing a banner afterwards does not reverse the earlier execution.

2. WordPress: Use a dedicated plugin

WordPress provides a plugin ecosystem for consent management.

Three options worth evaluating are:

ConsentX

The official plugin supports:

  • Automatic consent banner.
  • Third-party script, pixel and iframe blocking.
  • Google Consent Mode v2.
  • Region-aware behaviour.
  • WP Consent API.
  • Timestamped consent records.
  • Cookie policy generation.

Its plugin can work without an account. Connecting a free account adds cloud-held records, scanning and centralised management.

Installation:

  1. Open Plugins in WordPress.
  2. Search for ConsentX.
  3. Install and activate.
  4. Open ConsentX settings.
  5. Configure the banner and tracking categories.
  6. Test the result in a private browser window.

Sources: WordPress plugin and installation guide.

CookieYes

CookieYes provides automatic blocking, consent logging, Google Consent Mode v2 and cookie scanning through its connected service.

Source: WordPress plugin.

Complianz

Complianz is another WordPress-focused option with free and Premium functionality.

Source: Complianz.

3. Webflow: Use an app or script integration

Webflow does not use WordPress-style plugins.

Its documentation identifies several ways to manage consent.

Option A: Usercentrics Cookiebot

The setup is straightforward:

  1. Create a Cookiebot account.
  2. Register the Webflow domain.
  3. Configure the banner.
  4. Copy the installation script.
  5. Add it to the Webflow site header.
  6. Publish and test.

Cookiebot documents a free option for sites with up to 50 subpages. https://usercentrics.com/integrations/webflow/

Option B: FlowAppz Cookie Consent

The Webflow Marketplace application provides banner templates, regional settings, script controls and Google Consent Mode v2 signals.

It can also integrate with Google Tag Manager and support custom script attributes.

https://webflow.com/integrations/cookie-consent

Option C: Webflow Consent Pro

Webflow's Consent Pro application integrates with Webflow Insights, including Analyze and Optimize.

It supports opt-in and opt-out banner configurations based on the chosen tracking default.

It should not be confused with a universal third-party script blocker.

https://help.webflow.com/hc/en-us/articles/34394790067859-Integrate-Consent-Pro-for-consent-management

4. Custom websites: Use a script-based CMP

Custom websites may use:

  • React.
  • Next.js.
  • Vue.
  • Angular.
  • PHP.
  • Node.js.
  • Static HTML.

A script-based CMP is often easier to evaluate than a CMS-specific plugin.

ConsentX documents a manual installation method using a site-specific embed:

<script type="module"
  src="https://app.consentx.io/api/YOUR_SITE_KEY/embed.js">
</script>
Enter fullscreen mode Exit fullscreen mode

Place the integration in the appropriate early-loading location, replace the placeholder with the actual site key and register the domain in the CMP dashboard.

The exact placement and script-control configuration should follow the provider's developer documentation.

Termly also documents an installation method that requires its generated banner snippet to be placed first in the page head.

Sources:

5. A developer testing checklist

Test What to verify
First page load Consent initialises before configured trackers
Reject all Non-essential configured scripts remain blocked
Selective acceptance Only permitted categories activate
Withdrawal Updated consent state is respected
Reload Previous choice is handled correctly
Regional test Appropriate configuration is displayed
Cached page Consent behaviour remains correct
Mobile Banner and preference controls remain usable

Inspect the browser Network panel. Look for requests to analytics, advertising and embedded services before and after the visitor makes a choice.

6. Avoid common implementation mistakes

Late script loading: The CMP should initialise before the scripts it needs to control.

Duplicate consent tools: Multiple CMPs can conflict with each other. Use one clearly defined consent authority for each implementation.

Uncontrolled custom scripts: A CMP may not automatically identify every custom script. Explicitly configure and test them.

Caching issues: Verify that caching and optimisation plugins do not delay, combine or reorder consent-related scripts incorrectly.

Incomplete withdrawal: Changing a consent preference must update the actual behaviour, not just the stored interface state.

Conclusion

WordPress, Webflow and custom-coded websites need different implementation approaches.

ConsentX, CookieYes and Complianz are options to evaluate for WordPress. Usercentrics Cookiebot, FlowAppz and Webflow Consent Pro provide Webflow-oriented routes. ConsentX, Termly and Usercentrics Cookiebot can be evaluated for custom JavaScript installations.

The best implementation is the one that initialises at the right time, controls configured scripts correctly and handles updated visitor choices.

Top comments (0)