New support module for CookiePro's auto-blocking Drupal's scripts

Created on 20 March 2024, 3 months ago
Updated 6 May 2024, about 2 months ago

Thanks for your work on this module which works very well, except for auto-blocking which is no fault of the module.

As you know, the auto-blocking will stop many scripts from being executed which causes issues for lazy-loading, etc.

CookiePro allows scripts to be tagged with an attribute to ignore them, or to categorise them so the scripts can be allowed once consent has been given.

To make this easy, I've added a module to allow site maintainers to flag what type of categorisation a script or page attachment tag should have. It can support providers like CookiePro via additional plugins, so I invite you to add a plugin if you think that would benefit your users.

Please take a look, and include a link to it on your page if you think it will help people using your module. I'm sure I'm not the first developer to run into auto-blocking issues. You may also want to move the plugin implementation into your module.

Here's a link to the project - https://www.drupal.org/project/cookie_blocking_libraries β†’

✨ Feature request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom Dubs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Dubs
  • πŸ‡¬πŸ‡§United Kingdom Dubs
  • πŸ‡§πŸ‡ͺBelgium andreasderijcke Antwerpen / Gent

    @Dubs We kind of have this already, but not configurable through a UI. See https://git.drupalcode.org/project/cookiepro_plus/-/blob/1.0.x/examples/... and https://git.drupalcode.org/project/cookiepro_plus/-/blob/1.0.x/examples/....

    When reviewing and comparing with your current approach, a few concerns came to mind:

    • Specificity: Categories should be assigned at least at library level, not module level, so a module can support progressive enhancement of functionality depending on the given consent.
    • Aggregation incompatibility: this might be a problem in my solution as well, I've never used in the field so far, and keeping as much scripts aggregated as possible is a must have.

    I need to wrap my head around this a bit more in the next weeks, to see if this might be worth investing time on this addition, without having a known demand.
    I've always felt the 'auto-blocking' magic a bit too obscure and so far discouraged the use of it in combination with Drupal, in favour of complete control of what is to be blocked and when.
    Anyway, to be continued.

    If you have additional insights and ideas, let us know!

  • πŸ‡¬πŸ‡§United Kingdom Dubs

    @andreasderijcke - thanks for responding.

    I completely agree with both your points. I can change the code to support per module, probably with the option to flag the entire module too for ease of UI (think of all the Drupal core libraries, for example).

    Aggregation will be trickier. I haven't looked at the new D10 APIs for this but I am hoping there would be a way to alter the groupings, in which case we simply need to group the libraries by type and add the appropriate attribute. The client we developed this for is still on 9, but hopefully will be persuaded to move to 10 soon.

    Thanks again, and if you let me know the attributes for CookiePro I can throw together a plugin for it fairly quickly.

  • πŸ‡§πŸ‡ͺBelgium andreasderijcke Antwerpen / Gent

    With "the attributes for CookiePro", I'm not entirely sure what you need, but I guess the info is on this page: https://my.onetrust.com/s/article/UUID-71e7d0a8-03d8-e272-e683-72cadded2ecf

    If you need the exact consent categories (like 'C0004'), as those can be changed in CookiePro, they need to be configured in the module as well.
    \Drupal\cookiepro_plus\CookiePro::getCategoryIds() will return them, keyed by the internal key constants as defined in https://git.drupalcode.org/project/cookiepro_plus/-/blob/1.0.x/src/Cooki... (CONF_CATEGORY_...).

Production build 0.69.0 2024