Is it possible to prevent _ga and _ga_* being set by Google Analytics module prior to consent?

Created on 19 March 2025, 15 days ago

Problem/Motivation

When module Google Analytics is activated (google_analytics), I can't stop its cookies from being stored, even when enabling the Google Analytics service for the Klaro module. I can see the module appends code to load the external Google Tag Manager script at the very beginning of the source code, so it loads the tracking functionality as early as possible.

Is there anything I can do to prevent the tracking from being stored on the user's machine prior to him/her consenting to being tracked?

Steps to reproduce

  1. Install the Google Analytics module
  2. Configure the module to track an analytics account by supplying the unique GA tracking code.
  3. Activate Klaro
  4. Enable both the Google Analytics and the Google Tag Manager services on Klaro
  5. As an anonymous user, navigate to any page on the website and confirm it is still storing _ga and _ga_* cookies.

Proposed resolution

--

Remaining tasks

--

User interface changes

--

API changes

--

Data model changes

--

💬 Support request
Status

Needs review

Version

3.0

Component

Documentation

Created by

🇧🇷Brazil mabho Rio de Janeiro, RJ

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

Comments & Activities

Production build 0.71.5 2024