Integration to Consent-Management

Created on 30 June 2022, over 2 years ago
Updated 29 April 2024, 7 months ago

Problem/Motivation

Consent management is definitely a big problem for the GTM module. Every time the module is integrated, the developers are faced with the question of how to solve this problem for their customers (usually within a very limited time).

Proposed resolution

I would like to propose a solution to this problem. The COOKiES module β†’ , which I am a maintainer of, offers an API that makes it easy to solve this problem.

There is already a GTM support module in the COOKiES module, but the procedure if consent has not yet been given is rather rough: The entire GTM service is suppressed by deactivating the corresponding Javascript.

It is easily possible to adapt the service to Google's best practices, but the developers of the COOKiES module lack the know-how to do this. We can't dive too deep into the support of each 3rd party integration module. Our intention is to create a convenient API for developers to add additional 3rd party modules into the COOKiES support with as little effort as possible. On the one hand, our sub-modules are intended to provide examples of how developers can integrate their third-party providers themselves, and on the other hand to provide solid basic support.

A submodule or bridge module should be integrated into the GTM module, which connects the GTM module to the consent management of the COOKiES module.

This module can be activated depending on whether you want to use COOKiES or not. Since the COOKiES module follows the modus operandi of many other (proprietary) consent management modules, the code can be a great help for developers to cleanly transfer the GTM module to other systems. In this way, the GTM development team would have an environment to solve standard consent management problems and further develop the API so that updates of the API depend less on external resources.

The COOKiES team would definitely be willing to cooperate if you want to follow this suggestion.

What we can do for you

  • We can give an introduction to the COOKiES module e.g. by video call.
  • We can help to make a basic setup.
  • We can help to find problem-solutions.
  • We can test and review.

Our benefit

We try to establish COOKiES as popular standard for Drupal and I think we would make a big step in this direction.

Your benefit

You can provide a solid Out-Of-Box solution for Consent-Management inside the Drupal open-source ecosystem.
You can give working example-code and instruction to developers, how to integrate the GTM-Module to a Consent-Management.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany JFeltkamp Hamburg

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

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

    I'm sad to see there hasn't been a response to your suggestion @JFeltkamp.

    I'm unfortunately not knowledgeable enough about the Google Tag module to know whether I can help you code up a solution, but the organisation I work for use Google Tag and COOKiES and we have received a request to evaluate whether using Google's Consent Mode can be achieved.

    If we can create a patch for the GTag module in-house which we think might have some benefit to other users, we will be sure to post it here.

    Following this topic in the hope that someone much more capable comes up with a decent solution in the meantime!

    /Al

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @alexharries FYI: https://www.drupal.org/project/cookies β†’ contains a Google Tag Manager submodule - is that what you're looking for or are you aware of that and your comment was about Google Consent Mode additions to that?

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

    Thank you @Anybody.

    The issue here I think (/assume) is that there might need to be some change in how the GTag module loads the Google Tag script in order to let Google know that the user has declined consent.

    When the COOKiES module is installed, the GTag module can determine if the user has declined consent from the COOKiES module - how I don't yet know - but it would be this check and the subsequent change to how the Google Tag is loaded which would presumably either need to happen in the GTag module, or potentially through a couple of strategically-placed hook alters in the GTag module which an external module could make use of to change how the tag script is loaded.

    All of the above is vapourware/presumption until we can get a clear understanding of how this might work and what capability we already have in the GTag and COOKiES modules.

    Β―\_(ツ)_/Β―

    /Al

  • πŸ‡§πŸ‡ͺBelgium tijsdeboeck Antwerp πŸ‡§πŸ‡ͺ πŸ‡ͺπŸ‡Ί 🌎

    Hi @alexharries, I've posted a comment on this in the cookies issue queue, maybe it helps you: https://www.drupal.org/project/cookies/issues/3364470#comment-15120948 ✨ Add GA4 snippet support in cookies_ga Fixed

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

    Thank you @tijsdeboeck.

    So it looks like there is a sandbox module which should provide this functionality:
    https://www.drupal.org/sandbox/gresko8/3267405 β†’

    Downloading and testing now - many thanks.

    /Al

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Apparently this should work with the Cookies module for a while thanks to changes in πŸ› Google Tag manager is loaded without consent Fixed - has anyone confirmed this?

Production build 0.71.5 2024