Module for Cookie management and async loading of (external) scripts / assets

PrivacyWire

Cookie & Consent Manager for ProcessWire

This module adds the possibility to define cookie / consent groups and load corresponding elements only after the site visitor has given consent.
The following cookie groups are available (the frontend visible label is editable and translatable, this is just the technical name)

  • Necessary
  • Functional
  • Statistics
  • Marketing
  • External Media
  • (All Cookies)
    Necessary elements are always active. You can let the user decide, which individual cookie group(s) should be allowed, and/or add an „Allow all“ button.

You can use the (very basic) styles or use the completely unstyled version. Both script version are very small and thus fast (around 6kb for the styled version and around 5.2kb for the unstyled version).

To load scripts, frames, images or other elements only after the site visitor has given consent to that specific cookie group, use the following attributes:

<script type=text/plain" data-type="text/javascript" data-category="functional">console.log("This script only runs after giving consent to functional cookies");</script>

You can even render and alternate Opt-In text instead of the element:

<iframe data-src="https://processwire.com/" data-category="marketing" data-ask-consent="1" frameborder="0" height="400" width="400"></iframe>

Availabe attributes:

AttributeInfoDescriptionType
data-categoryrequireddefines the assigned cookie group for this elementstring
data-typeoptional (required for scripts)replaces the type attribute after giving consentstring
data-srcoptional (required for external scripts, images or iframes)replaces the src attribute after giving consentstring
data-srsetoptionalreplaces the srcset attribute for images after giving consentstring
data-ask-consentoptionalReplace element with Opt-In-Elementbool 0/1

For script tags it is required to add type=text/plain", otherwise the script executes directly.


With PrivacyWire itself comes a Textformatter with the shortcode [[privacywire-choose-cookies]] to add a button to show the cookie group selection window.
To automatically include the Opt-In-Element for embedded videos via TextformatterVideoEmbed you can choose the cookie group in the Textformatter settings.

Multiple language support / i18n


The module uses the ProcessWire-integrated translation system.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new—More
    20 November 2020
  • ProcessWire 3.0.168 core updates — More
    26 October 2020
  • This week a 2nd new module for processing Stripe payments has been added to FormBuilder. Unlike our other Stripe Inputfield, this new one supports 3D Secure (SCA) payments. We’ll take a closer look at it in this post, plus a live demo— More
    16 October 2020

Latest news

  • ProcessWire Weekly #342
    In the 342nd issue of ProcessWire Weekly we're going to check out brand new admin theme called Admin Theme Canvas, a new module called MatomoWire, latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 28 November 2020
  • New ProcessWire modules directory
    There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new.
    Blog / 20 November 2020
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits