@firebase/analytics 0.7.10 → 0.7.11-canary.13550089f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @firebase/analytics
2
2
 
3
+ ## 0.7.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`835f1d46a`](https://github.com/firebase/firebase-js-sdk/commit/835f1d46a6780535bc660ef7dc23293350d5fe43) [#6357](https://github.com/firebase/firebase-js-sdk/pull/6357) - Fix typo in GtagConfigParams
8
+
9
+ - Updated dependencies [[`efe2000fc`](https://github.com/firebase/firebase-js-sdk/commit/efe2000fc499e2c85c4e5e0fef6741ff3bad2eb0)]:
10
+ - @firebase/util@1.6.2
11
+ - @firebase/component@0.5.16
12
+ - @firebase/installations@0.5.11
13
+
3
14
  ## 0.7.10
4
15
 
5
16
  ### Patch Changes
@@ -42,6 +42,38 @@ export declare interface AnalyticsSettings {
42
42
  config?: GtagConfigParams | EventParams;
43
43
  }
44
44
 
45
+ /**
46
+ * Consent status settings for each consent type.
47
+ * For more information, see
48
+ * {@link https://developers.google.com/tag-platform/tag-manager/templates/consent-apis
49
+ * | the GA4 reference documentation for consent state and consent types}.
50
+ * @public
51
+ */
52
+ export declare interface ConsentSettings {
53
+ /** Enables storage, such as cookies, related to advertising */
54
+ ad_storage?: ConsentStatusString;
55
+ /** Enables storage, such as cookies, related to analytics (for example, visit duration) */
56
+ analytics_storage?: ConsentStatusString;
57
+ /**
58
+ * Enables storage that supports the functionality of the website or app such as language settings
59
+ */
60
+ functionality_storage?: ConsentStatusString;
61
+ /** Enables storage related to personalization such as video recommendations */
62
+ personalization_storage?: ConsentStatusString;
63
+ /**
64
+ * Enables storage related to security such as authentication functionality, fraud prevention,
65
+ * and other user protection.
66
+ */
67
+ security_storage?: ConsentStatusString;
68
+ [key: string]: unknown;
69
+ }
70
+
71
+ /**
72
+ * Whether a particular consent type has been granted or denied.
73
+ * @public
74
+ */
75
+ export declare type ConsentStatusString = 'granted' | 'denied';
76
+
45
77
  /**
46
78
  * Standard `gtag.js` control parameters.
47
79
  * For more information, see
@@ -195,7 +227,7 @@ export declare interface GtagConfigParams {
195
227
  * If set to false, disables all advertising features with `gtag.js`.
196
228
  * See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
197
229
  */
198
- 'allow_google_signals?': boolean;
230
+ 'allow_google_signals'?: boolean;
199
231
  /**
200
232
  * If set to false, disables all advertising personalization with `gtag.js`.
201
233
  * See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
@@ -637,6 +669,17 @@ export declare interface Promotion {
637
669
  */
638
670
  export declare function setAnalyticsCollectionEnabled(analyticsInstance: Analytics, enabled: boolean): void;
639
671
 
672
+ /**
673
+ * Sets the applicable end user consent state for this web app across all gtag references once
674
+ * Firebase Analytics is initialized.
675
+ *
676
+ * Use the {@link ConsentSettings} to specify individual consent type values. By default consent
677
+ * types are set to "granted".
678
+ * @public
679
+ * @param consentSettings - Maps the applicable end user consent state for gtag.js.
680
+ */
681
+ export declare function setConsent(consentSettings: ConsentSettings): void;
682
+
640
683
  /**
641
684
  * Use gtag `config` command to set `screen_name`.
642
685
  *
@@ -650,6 +693,15 @@ export declare function setAnalyticsCollectionEnabled(analyticsInstance: Analyti
650
693
  */
651
694
  export declare function setCurrentScreen(analyticsInstance: Analytics, screenName: string, options?: AnalyticsCallOptions): void;
652
695
 
696
+ /**
697
+ * Adds data that will be set on every event logged from the SDK, including automatic ones.
698
+ * With gtag's "set" command, the values passed persist on the current page and are passed with
699
+ * all subsequent events.
700
+ * @public
701
+ * @param customParams - Any custom params the user may pass to gtag.js.
702
+ */
703
+ export declare function setDefaultEventParameters(customParams: CustomParams): void;
704
+
653
705
  /**
654
706
  * Configures Firebase Analytics to use custom `gtag` or `dataLayer` names.
655
707
  * Intended to be used if `gtag.js` script has been installed on
@@ -42,6 +42,38 @@ export declare interface AnalyticsSettings {
42
42
  config?: GtagConfigParams | EventParams;
43
43
  }
44
44
 
45
+ /**
46
+ * Consent status settings for each consent type.
47
+ * For more information, see
48
+ * {@link https://developers.google.com/tag-platform/tag-manager/templates/consent-apis
49
+ * | the GA4 reference documentation for consent state and consent types}.
50
+ * @public
51
+ */
52
+ export declare interface ConsentSettings {
53
+ /** Enables storage, such as cookies, related to advertising */
54
+ ad_storage?: ConsentStatusString;
55
+ /** Enables storage, such as cookies, related to analytics (for example, visit duration) */
56
+ analytics_storage?: ConsentStatusString;
57
+ /**
58
+ * Enables storage that supports the functionality of the website or app such as language settings
59
+ */
60
+ functionality_storage?: ConsentStatusString;
61
+ /** Enables storage related to personalization such as video recommendations */
62
+ personalization_storage?: ConsentStatusString;
63
+ /**
64
+ * Enables storage related to security such as authentication functionality, fraud prevention,
65
+ * and other user protection.
66
+ */
67
+ security_storage?: ConsentStatusString;
68
+ [key: string]: unknown;
69
+ }
70
+
71
+ /**
72
+ * Whether a particular consent type has been granted or denied.
73
+ * @public
74
+ */
75
+ export declare type ConsentStatusString = 'granted' | 'denied';
76
+
45
77
  /**
46
78
  * Standard `gtag.js` control parameters.
47
79
  * For more information, see
@@ -195,7 +227,7 @@ export declare interface GtagConfigParams {
195
227
  * If set to false, disables all advertising features with `gtag.js`.
196
228
  * See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
197
229
  */
198
- 'allow_google_signals?': boolean;
230
+ 'allow_google_signals'?: boolean;
199
231
  /**
200
232
  * If set to false, disables all advertising personalization with `gtag.js`.
201
233
  * See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
@@ -637,6 +669,17 @@ export declare interface Promotion {
637
669
  */
638
670
  export declare function setAnalyticsCollectionEnabled(analyticsInstance: Analytics, enabled: boolean): void;
639
671
 
672
+ /**
673
+ * Sets the applicable end user consent state for this web app across all gtag references once
674
+ * Firebase Analytics is initialized.
675
+ *
676
+ * Use the {@link ConsentSettings} to specify individual consent type values. By default consent
677
+ * types are set to "granted".
678
+ * @public
679
+ * @param consentSettings - Maps the applicable end user consent state for gtag.js.
680
+ */
681
+ export declare function setConsent(consentSettings: ConsentSettings): void;
682
+
640
683
  /**
641
684
  * Use gtag `config` command to set `screen_name`.
642
685
  *
@@ -650,6 +693,15 @@ export declare function setAnalyticsCollectionEnabled(analyticsInstance: Analyti
650
693
  */
651
694
  export declare function setCurrentScreen(analyticsInstance: Analytics, screenName: string, options?: AnalyticsCallOptions): void;
652
695
 
696
+ /**
697
+ * Adds data that will be set on every event logged from the SDK, including automatic ones.
698
+ * With gtag's "set" command, the values passed persist on the current page and are passed with
699
+ * all subsequent events.
700
+ * @public
701
+ * @param customParams - Any custom params the user may pass to gtag.js.
702
+ */
703
+ export declare function setDefaultEventParameters(customParams: CustomParams): void;
704
+
653
705
  /**
654
706
  * Configures Firebase Analytics to use custom `gtag` or `dataLayer` names.
655
707
  * Intended to be used if `gtag.js` script has been installed on