Disabling Javascript with "Opt-in with categories" enable seems to not work

Created on 16 December 2021, about 3 years ago
Updated 22 October 2023, about 1 year ago

Problem/Motivation

With "Consent method: opt-in" if I put some script with syntax "path/to/the/script.js" in "Disable JavaScripts" with "Enable cookie(s) automatic-removal when consent isn't given" everything seems to work as expected. Untill I agree the script is not working, after i agree the script is working and cookies setted up.

If i use che same script with the "Opt-in with categories" , and I put inside "Disable JavaScripts" the line with syntax category:path/to/the/script.js with "Enable cookie(s) automatic-removal the script seems to never load, even if i agree for the specific category.
If i check the browser cookies are not setted up.

🐛 Bug report
Status

Postponed: needs info

Version

1.19

Component

Code

Created by

🇮🇹Italy davidebarbato

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.

  • Status changed to Postponed: needs info about 1 year ago
  • 🇳🇴Norway svenryen

    I'm not the most experienced GTM/GA user, but I did set up an account at https://tagmanager.google.com/#/home and https://analytics.google.com/analytics/web/.

    Best practice nowadays seems to be using the google_tag module, so I installed, enabled and configured that module to load my GTM tag.

    Once that's set up and confirmed working, I set up my site to Opt-in users to tracking and listed the two scripts of the google_tag module in "Disable JavaScripts".

    The value of the field is:

    <blockquote>modules/contrib/google_tag/js/gtag.js
    modules/contrib/google_tag/js/gtm.js</blockquote>

    I also tried the same setup with a category added to the mix:

    <blockquote>analytics:modules/contrib/google_tag/js/gtag.js
    analytics:modules/contrib/google_tag/js/gtm.js</blockquote>

    Loading that page in a few incognito windows demonstrates that there's no GA traffic recorded until the consent was given, and after it was given, the googletagmanager script loads and records my activity in GA4.

    It seems this module doesn't create a sites/default/files/google_tag/google_tag.script.js file. Could you add some information as to what module provides that file? Is it possible to attempt using the google_tag module to achieve your desired outcome, or is there some feature google_tag lacks?

Production build 0.71.5 2024