@firebase/analytics 0.10.9 → 0.10.10-canary.ffbf5a60a

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.
Files changed (49) hide show
  1. package/dist/esm/index.esm2017.js +1241 -1241
  2. package/dist/esm/index.esm2017.js.map +1 -1
  3. package/dist/esm/src/api.d.ts +453 -453
  4. package/dist/esm/src/api.test.d.ts +17 -17
  5. package/dist/esm/src/constants.d.ts +32 -32
  6. package/dist/esm/src/errors.d.ts +57 -57
  7. package/dist/esm/src/factory.d.ts +74 -74
  8. package/dist/esm/src/functions.d.ts +85 -85
  9. package/dist/esm/src/functions.test.d.ts +17 -17
  10. package/dist/esm/src/get-config.d.ts +72 -72
  11. package/dist/esm/src/get-config.test.d.ts +17 -17
  12. package/dist/esm/src/helpers.d.ts +70 -71
  13. package/dist/esm/src/helpers.test.d.ts +17 -17
  14. package/dist/esm/src/index.d.ts +14 -14
  15. package/dist/esm/src/index.test.d.ts +17 -17
  16. package/dist/esm/src/initialize-analytics.d.ts +36 -36
  17. package/dist/esm/src/initialize-analytics.test.d.ts +17 -17
  18. package/dist/esm/src/logger.d.ts +18 -18
  19. package/dist/esm/src/public-types.d.ts +282 -282
  20. package/dist/esm/src/types.d.ts +55 -55
  21. package/dist/esm/testing/get-fake-firebase-services.d.ts +29 -29
  22. package/dist/esm/testing/gtag-script-util.d.ts +1 -1
  23. package/dist/esm/testing/integration-tests/integration.d.ts +18 -18
  24. package/dist/esm/testing/setup.d.ts +17 -17
  25. package/dist/index.cjs.js +1241 -1241
  26. package/dist/index.cjs.js.map +1 -1
  27. package/dist/src/api.d.ts +453 -453
  28. package/dist/src/api.test.d.ts +17 -17
  29. package/dist/src/constants.d.ts +32 -32
  30. package/dist/src/errors.d.ts +57 -57
  31. package/dist/src/factory.d.ts +74 -74
  32. package/dist/src/functions.d.ts +85 -85
  33. package/dist/src/functions.test.d.ts +17 -17
  34. package/dist/src/get-config.d.ts +72 -72
  35. package/dist/src/get-config.test.d.ts +17 -17
  36. package/dist/src/helpers.d.ts +70 -71
  37. package/dist/src/helpers.test.d.ts +17 -17
  38. package/dist/src/index.d.ts +14 -14
  39. package/dist/src/index.test.d.ts +17 -17
  40. package/dist/src/initialize-analytics.d.ts +36 -36
  41. package/dist/src/initialize-analytics.test.d.ts +17 -17
  42. package/dist/src/logger.d.ts +18 -18
  43. package/dist/src/public-types.d.ts +282 -282
  44. package/dist/src/types.d.ts +55 -55
  45. package/dist/testing/get-fake-firebase-services.d.ts +29 -29
  46. package/dist/testing/gtag-script-util.d.ts +1 -1
  47. package/dist/testing/integration-tests/integration.d.ts +18 -18
  48. package/dist/testing/setup.d.ts +17 -17
  49. package/package.json +8 -8
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import '../testing/setup';
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../testing/setup';
@@ -1,32 +1,32 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * Type constant for Firebase Analytics.
19
- */
20
- export declare const ANALYTICS_TYPE = "analytics";
21
- export declare const GA_FID_KEY = "firebase_id";
22
- export declare const ORIGIN_KEY = "origin";
23
- export declare const FETCH_TIMEOUT_MILLIS: number;
24
- export declare const DYNAMIC_CONFIG_URL = "https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig";
25
- export declare const GTAG_URL = "https://www.googletagmanager.com/gtag/js";
26
- export declare const enum GtagCommand {
27
- EVENT = "event",
28
- SET = "set",
29
- CONFIG = "config",
30
- CONSENT = "consent",
31
- GET = "get"
32
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Type constant for Firebase Analytics.
19
+ */
20
+ export declare const ANALYTICS_TYPE = "analytics";
21
+ export declare const GA_FID_KEY = "firebase_id";
22
+ export declare const ORIGIN_KEY = "origin";
23
+ export declare const FETCH_TIMEOUT_MILLIS: number;
24
+ export declare const DYNAMIC_CONFIG_URL = "https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig";
25
+ export declare const GTAG_URL = "https://www.googletagmanager.com/gtag/js";
26
+ export declare const enum GtagCommand {
27
+ EVENT = "event",
28
+ SET = "set",
29
+ CONFIG = "config",
30
+ CONSENT = "consent",
31
+ GET = "get"
32
+ }
@@ -1,57 +1,57 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { ErrorFactory } from '@firebase/util';
18
- export declare const enum AnalyticsError {
19
- ALREADY_EXISTS = "already-exists",
20
- ALREADY_INITIALIZED = "already-initialized",
21
- ALREADY_INITIALIZED_SETTINGS = "already-initialized-settings",
22
- INTEROP_COMPONENT_REG_FAILED = "interop-component-reg-failed",
23
- INVALID_ANALYTICS_CONTEXT = "invalid-analytics-context",
24
- INDEXEDDB_UNAVAILABLE = "indexeddb-unavailable",
25
- FETCH_THROTTLE = "fetch-throttle",
26
- CONFIG_FETCH_FAILED = "config-fetch-failed",
27
- NO_API_KEY = "no-api-key",
28
- NO_APP_ID = "no-app-id",
29
- NO_CLIENT_ID = "no-client-id",
30
- INVALID_GTAG_RESOURCE = "invalid-gtag-resource"
31
- }
32
- interface ErrorParams {
33
- [AnalyticsError.ALREADY_EXISTS]: {
34
- id: string;
35
- };
36
- [AnalyticsError.INTEROP_COMPONENT_REG_FAILED]: {
37
- reason: Error;
38
- };
39
- [AnalyticsError.FETCH_THROTTLE]: {
40
- throttleEndTimeMillis: number;
41
- };
42
- [AnalyticsError.CONFIG_FETCH_FAILED]: {
43
- httpStatus: number;
44
- responseMessage: string;
45
- };
46
- [AnalyticsError.INVALID_ANALYTICS_CONTEXT]: {
47
- errorInfo: string;
48
- };
49
- [AnalyticsError.INDEXEDDB_UNAVAILABLE]: {
50
- errorInfo: string;
51
- };
52
- [AnalyticsError.INVALID_GTAG_RESOURCE]: {
53
- gtagURL: string;
54
- };
55
- }
56
- export declare const ERROR_FACTORY: ErrorFactory<AnalyticsError, ErrorParams>;
57
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ErrorFactory } from '@firebase/util';
18
+ export declare const enum AnalyticsError {
19
+ ALREADY_EXISTS = "already-exists",
20
+ ALREADY_INITIALIZED = "already-initialized",
21
+ ALREADY_INITIALIZED_SETTINGS = "already-initialized-settings",
22
+ INTEROP_COMPONENT_REG_FAILED = "interop-component-reg-failed",
23
+ INVALID_ANALYTICS_CONTEXT = "invalid-analytics-context",
24
+ INDEXEDDB_UNAVAILABLE = "indexeddb-unavailable",
25
+ FETCH_THROTTLE = "fetch-throttle",
26
+ CONFIG_FETCH_FAILED = "config-fetch-failed",
27
+ NO_API_KEY = "no-api-key",
28
+ NO_APP_ID = "no-app-id",
29
+ NO_CLIENT_ID = "no-client-id",
30
+ INVALID_GTAG_RESOURCE = "invalid-gtag-resource"
31
+ }
32
+ interface ErrorParams {
33
+ [AnalyticsError.ALREADY_EXISTS]: {
34
+ id: string;
35
+ };
36
+ [AnalyticsError.INTEROP_COMPONENT_REG_FAILED]: {
37
+ reason: Error;
38
+ };
39
+ [AnalyticsError.FETCH_THROTTLE]: {
40
+ throttleEndTimeMillis: number;
41
+ };
42
+ [AnalyticsError.CONFIG_FETCH_FAILED]: {
43
+ httpStatus: number;
44
+ responseMessage: string;
45
+ };
46
+ [AnalyticsError.INVALID_ANALYTICS_CONTEXT]: {
47
+ errorInfo: string;
48
+ };
49
+ [AnalyticsError.INDEXEDDB_UNAVAILABLE]: {
50
+ errorInfo: string;
51
+ };
52
+ [AnalyticsError.INVALID_GTAG_RESOURCE]: {
53
+ gtagURL: string;
54
+ };
55
+ }
56
+ export declare const ERROR_FACTORY: ErrorFactory<AnalyticsError, ErrorParams>;
57
+ export {};
@@ -1,74 +1,74 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { SettingsOptions, Analytics, AnalyticsSettings } from './public-types';
18
- import { Gtag, DynamicConfig, MinimalDynamicConfig } from './types';
19
- import { _FirebaseInstallationsInternal } from '@firebase/installations';
20
- import { FirebaseApp, _FirebaseService } from '@firebase/app';
21
- /**
22
- * Analytics Service class.
23
- */
24
- export declare class AnalyticsService implements Analytics, _FirebaseService {
25
- app: FirebaseApp;
26
- constructor(app: FirebaseApp);
27
- _delete(): Promise<void>;
28
- }
29
- /**
30
- * Maps appId to full initialization promise. Wrapped gtag calls must wait on
31
- * all or some of these, depending on the call's `send_to` param and the status
32
- * of the dynamic config fetches (see below).
33
- */
34
- export declare let initializationPromisesMap: {
35
- [appId: string]: Promise<string>;
36
- };
37
- /**
38
- * Wrapper around gtag function that ensures FID is sent with all
39
- * relevant event and config calls.
40
- */
41
- export declare let wrappedGtagFunction: Gtag;
42
- /**
43
- * For testing
44
- * @internal
45
- */
46
- export declare function resetGlobalVars(newGlobalInitDone?: boolean, newInitializationPromisesMap?: {}, newDynamicPromises?: never[]): void;
47
- /**
48
- * For testing
49
- * @internal
50
- */
51
- export declare function getGlobalVars(): {
52
- initializationPromisesMap: {
53
- [appId: string]: Promise<string>;
54
- };
55
- dynamicConfigPromisesList: Array<Promise<DynamicConfig | MinimalDynamicConfig>>;
56
- };
57
- /**
58
- * Configures Firebase Analytics to use custom `gtag` or `dataLayer` names.
59
- * Intended to be used if `gtag.js` script has been installed on
60
- * this page independently of Firebase Analytics, and is using non-default
61
- * names for either the `gtag` function or for `dataLayer`.
62
- * Must be called before calling `getAnalytics()` or it won't
63
- * have any effect.
64
- *
65
- * @public
66
- *
67
- * @param options - Custom gtag and dataLayer names.
68
- */
69
- export declare function settings(options: SettingsOptions): void;
70
- /**
71
- * Analytics instance factory.
72
- * @internal
73
- */
74
- export declare function factory(app: FirebaseApp, installations: _FirebaseInstallationsInternal, options?: AnalyticsSettings): AnalyticsService;
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { SettingsOptions, Analytics, AnalyticsSettings } from './public-types';
18
+ import { Gtag, DynamicConfig, MinimalDynamicConfig } from './types';
19
+ import { _FirebaseInstallationsInternal } from '@firebase/installations';
20
+ import { FirebaseApp, _FirebaseService } from '@firebase/app';
21
+ /**
22
+ * Analytics Service class.
23
+ */
24
+ export declare class AnalyticsService implements Analytics, _FirebaseService {
25
+ app: FirebaseApp;
26
+ constructor(app: FirebaseApp);
27
+ _delete(): Promise<void>;
28
+ }
29
+ /**
30
+ * Maps appId to full initialization promise. Wrapped gtag calls must wait on
31
+ * all or some of these, depending on the call's `send_to` param and the status
32
+ * of the dynamic config fetches (see below).
33
+ */
34
+ export declare let initializationPromisesMap: {
35
+ [appId: string]: Promise<string>;
36
+ };
37
+ /**
38
+ * Wrapper around gtag function that ensures FID is sent with all
39
+ * relevant event and config calls.
40
+ */
41
+ export declare let wrappedGtagFunction: Gtag;
42
+ /**
43
+ * For testing
44
+ * @internal
45
+ */
46
+ export declare function resetGlobalVars(newGlobalInitDone?: boolean, newInitializationPromisesMap?: {}, newDynamicPromises?: never[]): void;
47
+ /**
48
+ * For testing
49
+ * @internal
50
+ */
51
+ export declare function getGlobalVars(): {
52
+ initializationPromisesMap: {
53
+ [appId: string]: Promise<string>;
54
+ };
55
+ dynamicConfigPromisesList: Array<Promise<DynamicConfig | MinimalDynamicConfig>>;
56
+ };
57
+ /**
58
+ * Configures Firebase Analytics to use custom `gtag` or `dataLayer` names.
59
+ * Intended to be used if `gtag.js` script has been installed on
60
+ * this page independently of Firebase Analytics, and is using non-default
61
+ * names for either the `gtag` function or for `dataLayer`.
62
+ * Must be called before calling `getAnalytics()` or it won't
63
+ * have any effect.
64
+ *
65
+ * @public
66
+ *
67
+ * @param options - Custom gtag and dataLayer names.
68
+ */
69
+ export declare function settings(options: SettingsOptions): void;
70
+ /**
71
+ * Analytics instance factory.
72
+ * @internal
73
+ */
74
+ export declare function factory(app: FirebaseApp, installations: _FirebaseInstallationsInternal, options?: AnalyticsSettings): AnalyticsService;
@@ -1,85 +1,85 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { AnalyticsCallOptions, CustomParams, EventParams, ConsentSettings } from './public-types';
18
- import { Gtag } from './types';
19
- /**
20
- * Event parameters to set on 'gtag' during initialization.
21
- */
22
- export declare let defaultEventParametersForInit: CustomParams | undefined;
23
- /**
24
- * Logs an analytics event through the Firebase SDK.
25
- *
26
- * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
27
- * @param eventName Google Analytics event name, choose from standard list or use a custom string.
28
- * @param eventParams Analytics event parameters.
29
- */
30
- export declare function logEvent(gtagFunction: Gtag, initializationPromise: Promise<string>, eventName: string, eventParams?: EventParams, options?: AnalyticsCallOptions): Promise<void>;
31
- /**
32
- * Set screen_name parameter for this Google Analytics ID.
33
- *
34
- * @deprecated Use {@link logEvent} with `eventName` as 'screen_view' and add relevant `eventParams`.
35
- * See {@link https://firebase.google.com/docs/analytics/screenviews | Track Screenviews}.
36
- *
37
- * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
38
- * @param screenName Screen name string to set.
39
- */
40
- export declare function setCurrentScreen(gtagFunction: Gtag, initializationPromise: Promise<string>, screenName: string | null, options?: AnalyticsCallOptions): Promise<void>;
41
- /**
42
- * Set user_id parameter for this Google Analytics ID.
43
- *
44
- * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
45
- * @param id User ID string to set
46
- */
47
- export declare function setUserId(gtagFunction: Gtag, initializationPromise: Promise<string>, id: string | null, options?: AnalyticsCallOptions): Promise<void>;
48
- /**
49
- * Set all other user properties other than user_id and screen_name.
50
- *
51
- * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
52
- * @param properties Map of user properties to set
53
- */
54
- export declare function setUserProperties(gtagFunction: Gtag, initializationPromise: Promise<string>, properties: CustomParams, options?: AnalyticsCallOptions): Promise<void>;
55
- /**
56
- * Retrieves a unique Google Analytics identifier for the web client.
57
- * See {@link https://developers.google.com/analytics/devguides/collection/ga4/reference/config#client_id | client_id}.
58
- *
59
- * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
60
- */
61
- export declare function internalGetGoogleAnalyticsClientId(gtagFunction: Gtag, initializationPromise: Promise<string>): Promise<string>;
62
- /**
63
- * Set whether collection is enabled for this ID.
64
- *
65
- * @param enabled If true, collection is enabled for this ID.
66
- */
67
- export declare function setAnalyticsCollectionEnabled(initializationPromise: Promise<string>, enabled: boolean): Promise<void>;
68
- /**
69
- * Consent parameters to default to during 'gtag' initialization.
70
- */
71
- export declare let defaultConsentSettingsForInit: ConsentSettings | undefined;
72
- /**
73
- * Sets the variable {@link defaultConsentSettingsForInit} for use in the initialization of
74
- * analytics.
75
- *
76
- * @param consentSettings Maps the applicable end user consent state for gtag.js.
77
- */
78
- export declare function _setConsentDefaultForInit(consentSettings?: ConsentSettings): void;
79
- /**
80
- * Sets the variable `defaultEventParametersForInit` for use in the initialization of
81
- * analytics.
82
- *
83
- * @param customParams Any custom params the user may pass to gtag.js.
84
- */
85
- export declare function _setDefaultEventParametersForInit(customParams?: CustomParams): void;
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { AnalyticsCallOptions, CustomParams, EventParams, ConsentSettings } from './public-types';
18
+ import { Gtag } from './types';
19
+ /**
20
+ * Event parameters to set on 'gtag' during initialization.
21
+ */
22
+ export declare let defaultEventParametersForInit: CustomParams | undefined;
23
+ /**
24
+ * Logs an analytics event through the Firebase SDK.
25
+ *
26
+ * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
27
+ * @param eventName Google Analytics event name, choose from standard list or use a custom string.
28
+ * @param eventParams Analytics event parameters.
29
+ */
30
+ export declare function logEvent(gtagFunction: Gtag, initializationPromise: Promise<string>, eventName: string, eventParams?: EventParams, options?: AnalyticsCallOptions): Promise<void>;
31
+ /**
32
+ * Set screen_name parameter for this Google Analytics ID.
33
+ *
34
+ * @deprecated Use {@link logEvent} with `eventName` as 'screen_view' and add relevant `eventParams`.
35
+ * See {@link https://firebase.google.com/docs/analytics/screenviews | Track Screenviews}.
36
+ *
37
+ * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
38
+ * @param screenName Screen name string to set.
39
+ */
40
+ export declare function setCurrentScreen(gtagFunction: Gtag, initializationPromise: Promise<string>, screenName: string | null, options?: AnalyticsCallOptions): Promise<void>;
41
+ /**
42
+ * Set user_id parameter for this Google Analytics ID.
43
+ *
44
+ * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
45
+ * @param id User ID string to set
46
+ */
47
+ export declare function setUserId(gtagFunction: Gtag, initializationPromise: Promise<string>, id: string | null, options?: AnalyticsCallOptions): Promise<void>;
48
+ /**
49
+ * Set all other user properties other than user_id and screen_name.
50
+ *
51
+ * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
52
+ * @param properties Map of user properties to set
53
+ */
54
+ export declare function setUserProperties(gtagFunction: Gtag, initializationPromise: Promise<string>, properties: CustomParams, options?: AnalyticsCallOptions): Promise<void>;
55
+ /**
56
+ * Retrieves a unique Google Analytics identifier for the web client.
57
+ * See {@link https://developers.google.com/analytics/devguides/collection/ga4/reference/config#client_id | client_id}.
58
+ *
59
+ * @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
60
+ */
61
+ export declare function internalGetGoogleAnalyticsClientId(gtagFunction: Gtag, initializationPromise: Promise<string>): Promise<string>;
62
+ /**
63
+ * Set whether collection is enabled for this ID.
64
+ *
65
+ * @param enabled If true, collection is enabled for this ID.
66
+ */
67
+ export declare function setAnalyticsCollectionEnabled(initializationPromise: Promise<string>, enabled: boolean): Promise<void>;
68
+ /**
69
+ * Consent parameters to default to during 'gtag' initialization.
70
+ */
71
+ export declare let defaultConsentSettingsForInit: ConsentSettings | undefined;
72
+ /**
73
+ * Sets the variable {@link defaultConsentSettingsForInit} for use in the initialization of
74
+ * analytics.
75
+ *
76
+ * @param consentSettings Maps the applicable end user consent state for gtag.js.
77
+ */
78
+ export declare function _setConsentDefaultForInit(consentSettings?: ConsentSettings): void;
79
+ /**
80
+ * Sets the variable `defaultEventParametersForInit` for use in the initialization of
81
+ * analytics.
82
+ *
83
+ * @param customParams Any custom params the user may pass to gtag.js.
84
+ */
85
+ export declare function _setDefaultEventParametersForInit(customParams?: CustomParams): void;
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import '../testing/setup';
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../testing/setup';