Description
I wish to be able to fully disable analytics packages until a User enables them, so they don’t create Cookies before consent.
Examples
As much as I know, we can not use Cookies in EU, until users don’t accept a Cookie Consent.
Even I set state.analytics.pageviews
and state.analytics.events
to false, @frontity/google-analytics
will initialize the https://www.google-analytics.com/analytics.js
script, which will create cookies instantly.
Possible solutions
Settings:
-
Create a global option in the analytics package for cookie consent.
-
OR if both
state.analytics.pageviews
andstate.analytics.events
are false, disable the analytics package.
Way to solve it:
- Don’t include analytics packeges until user does not accept cookie consent
- Or disable analytics packages one-by-one. E.g.: GA can be disabled like this:
window['ga-disable-UA-XXXXXX-Y'] = true;