brainsum / cookieconsent

A Javascript based solution for blocking/allowing even 3rd party cookies to comply with GDPR
https://brainsum.github.io/cookieconsent/
ISC License
407 stars 88 forks source link

Doesnt work with Google Analytics #51

Open AreSee opened 3 years ago

AreSee commented 3 years ago

Hi,

I have the following code:

test

test

I used the script-tag method, i think its right so?

But, 1 of 2 Cookies ist always set from google: This one: _ga_22JLETJRER

and this is blocked: _ga

... When i change this:

            // Known cookie name.
            name: '_ga',

To this: name: '_ga',

then both are blocked.

I dont know why.

omenegazzi commented 3 years ago

Hello,

In the old version of Google Analytics it works perfect using the formatted UA_XXXXXXXXX_X. In the new version of Google Analytics 4 that uses the format: G-XXXXXXXXXX, it does not work.