Add possibility to disable analytics packages until user don't accept cookies

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:

  1. Create a global option in the analytics package for cookie consent.

  2. OR if both state.analytics.pageviews and state.analytics.events are false, disable the analytics package.

Way to solve it:

  1. Don’t include analytics packeges until user does not accept cookie consent
  2. Or disable analytics packages one-by-one. E.g.: GA can be disabled like this: window['ga-disable-UA-XXXXXX-Y'] = true;