I wish to be able to fully disable analytics packages until a User enables them, so they don’t create Cookies before consent.
Even I set
state.analytics.events to false,
@frontity/google-analytics will initialize the
https://www.google-analytics.com/analytics.js script, which will create cookies instantly.
Create a global option in the analytics package for cookie consent.
OR if both
state.analytics.eventsare 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;