Jump to content

Recommended Posts

Posted

Hi everyone,

I'd like to share Cookie, a consent management module I've been building — a consent banner, preferences window, server-side auto-blocking of trackers, and an interactive visual builder for styling the whole thing without touching CSS.

fGCAr.gif.c8fcdf816660d8a2a2fd58e6cb50606f.gif

Why

Most consent solutions I looked at made you choose: either you get compliance (trackers actually blocked before consent) or you get design control (colors, layout, icon placement) — rarely both without editing CSS/JS by hand. Cookie tries to give you both.

What it does

  • Consent-first by default. Known trackers and embeds (GTM, Google Analytics, Yandex Metrika, Meta Pixel, Hotjar, Clarity, DoubleClick, TikTok, YouTube, Vimeo, Google Maps and more) are neutralized server-side, in the rendered page, before it reaches the browser.
  • Two consent models: opt-in (GDPR/ePrivacy, UK GDPR/PECR, LGPD, Law 25, POPIA, KVKK) and opt-out (CCPA/CPRA and other US state laws), plus Global Privacy Control support, and a geo mode that picks the model automatically by visitor country.
  • Category-based blocking of scripts, iframes, images and video, with placeholders and multi-category requirements.
  • A visual builder (Setup > Cookie — "Design Studio"): live-preview layout, colors, fonts, radius, shadows, spacing. 50 color presets, 25 icon-color presets, 18 dark-theme presets.
  • A floating settings icon with 7 built-in choices, adjustable shape/size/position/color/shadow, including a transparent icon-only mode.
  • A dark theme with its own live-edited color set.
  • A services catalog + cookie policy generator.
  • Google Consent Mode v2, consent expiry/versioning, JS API, CustomEvents.
  • Optional consent log with CSV export and a small statistics dashboard.
  • Everything is hookable, and it's multi-language out of the box with per-language text targeting.

Basic usage

<script type="text/plain" data-consent="statistics" src="https://example.com/analytics.js"></script>
$wire->addHookAfter('Cookie::allowCategory', function($e) {
    if ($e->arguments(0) === 'marketing') $e->return = false;
});

Installation

Copy to /site/modules/, install, configure texts/categories in module settings, design the widget in Setup > Cookie.

Requires ProcessWire 3.0.244+ and PHP 8.2+. MPL-2.0 licensed.

Full docs and hooks reference: README. This is the 1.0.0 release — feedback and bug reports welcome!


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...