@firebase/analytics-compat 0.2.15-canary.a97ac88db → 0.2.15-canary.e577a408c

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.
@@ -1,40 +1,71 @@
1
- /**
2
- * @license
3
- * Copyright 2021 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 { FirebaseAnalytics } from '@firebase/analytics-types';
18
- export declare function registerAnalytics(): void;
19
- /**
20
- * Define extension behavior of `registerAnalytics`
21
- */
22
- declare module '@firebase/app-compat' {
23
- interface FirebaseNamespace {
24
- analytics(app?: FirebaseApp): FirebaseAnalytics;
25
- }
26
- interface FirebaseApp {
27
- analytics(): FirebaseAnalytics;
28
- }
29
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2021 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 { FirebaseAnalytics } from '@firebase/analytics-types';
18
+ export declare function registerAnalytics(): void;
19
+ /**
20
+ * Define extension behavior of `registerAnalytics`
21
+ */
22
+ declare module '@firebase/app-compat' {
23
+ interface FirebaseNamespace {
24
+ analytics(app?: FirebaseApp): FirebaseAnalytics;
25
+ }
26
+ interface FirebaseApp {
27
+ analytics(): FirebaseAnalytics;
28
+ }
29
+ }
30
30
 
31
31
  import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat";
32
32
  import { type Analytics, type AnalyticsSettings, type EventParams, type AnalyticsCallOptions, type CustomEventName, type CustomParams } from "@firebase/analytics";
33
33
  declare module "@firebase/analytics" {
34
- function getAnalytics(app?: FirebaseAppCompat): Analytics;
35
- function getGoogleAnalyticsClientId(analyticsInstance: FirebaseAnalytics): Promise<string>;
36
- function initializeAnalytics(app: FirebaseAppCompat, options?: AnalyticsSettings): Analytics;
37
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_payment_info', eventParams?: {
34
+ /**
35
+ * Returns an {@link Analytics} instance for the given app.
36
+ *
37
+ * @public
38
+ *
39
+ * @param app - The {@link @firebase/app#FirebaseApp} to use.
40
+ */
41
+ export declare function getAnalytics(app?: FirebaseAppCompat): Analytics;
42
+ /**
43
+ * Retrieves a unique Google Analytics identifier for the web client.
44
+ * See {@link https://developers.google.com/analytics/devguides/collection/ga4/reference/config#client_id | client_id}.
45
+ *
46
+ * @public
47
+ *
48
+ * @param app - The {@link @firebase/app#FirebaseApp} to use.
49
+ */
50
+ export declare function getGoogleAnalyticsClientId(analyticsInstance: FirebaseAnalytics): Promise<string>;
51
+ /**
52
+ * Returns an {@link Analytics} instance for the given app.
53
+ *
54
+ * @public
55
+ *
56
+ * @param app - The {@link @firebase/app#FirebaseApp} to use.
57
+ */
58
+ export declare function initializeAnalytics(app: FirebaseAppCompat, options?: AnalyticsSettings): Analytics;
59
+ /**
60
+ * Sends a Google Analytics event with given `eventParams`. This method
61
+ * automatically associates this logged event with this Firebase web
62
+ * app instance on this device.
63
+ * @public
64
+ * List of recommended event parameters can be found in
65
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
66
+ * | the GA4 reference documentation}.
67
+ */
68
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_payment_info', eventParams?: {
38
69
  coupon?: EventParams['coupon'];
39
70
  currency?: EventParams['currency'];
40
71
  items?: EventParams['items'];
@@ -42,7 +73,16 @@ declare module "@firebase/analytics" {
42
73
  value?: EventParams['value'];
43
74
  [key: string]: any;
44
75
  }, options?: AnalyticsCallOptions): void;
45
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_shipping_info', eventParams?: {
76
+ /**
77
+ * Sends a Google Analytics event with given `eventParams`. This method
78
+ * automatically associates this logged event with this Firebase web
79
+ * app instance on this device.
80
+ * @public
81
+ * List of recommended event parameters can be found in
82
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
83
+ * | the GA4 reference documentation}.
84
+ */
85
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_shipping_info', eventParams?: {
46
86
  coupon?: EventParams['coupon'];
47
87
  currency?: EventParams['currency'];
48
88
  items?: EventParams['items'];
@@ -50,20 +90,47 @@ declare module "@firebase/analytics" {
50
90
  value?: EventParams['value'];
51
91
  [key: string]: any;
52
92
  }, options?: AnalyticsCallOptions): void;
53
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_to_cart' | 'add_to_wishlist' | 'remove_from_cart', eventParams?: {
93
+ /**
94
+ * Sends a Google Analytics event with given `eventParams`. This method
95
+ * automatically associates this logged event with this Firebase web
96
+ * app instance on this device.
97
+ * @public
98
+ * List of recommended event parameters can be found in
99
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
100
+ * | the GA4 reference documentation}.
101
+ */
102
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'add_to_cart' | 'add_to_wishlist' | 'remove_from_cart', eventParams?: {
54
103
  currency?: EventParams['currency'];
55
104
  value?: EventParams['value'];
56
105
  items?: EventParams['items'];
57
106
  [key: string]: any;
58
107
  }, options?: AnalyticsCallOptions): void;
59
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'begin_checkout', eventParams?: {
108
+ /**
109
+ * Sends a Google Analytics event with given `eventParams`. This method
110
+ * automatically associates this logged event with this Firebase web
111
+ * app instance on this device.
112
+ * @public
113
+ * List of recommended event parameters can be found in
114
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
115
+ * | the GA4 reference documentation}.
116
+ */
117
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'begin_checkout', eventParams?: {
60
118
  currency?: EventParams['currency'];
61
119
  coupon?: EventParams['coupon'];
62
120
  value?: EventParams['value'];
63
121
  items?: EventParams['items'];
64
122
  [key: string]: any;
65
123
  }, options?: AnalyticsCallOptions): void;
66
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'checkout_progress', eventParams?: {
124
+ /**
125
+ * Sends a Google Analytics event with given `eventParams`. This method
126
+ * automatically associates this logged event with this Firebase web
127
+ * app instance on this device.
128
+ * @public
129
+ * List of recommended event parameters can be found in
130
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
131
+ * | the GA4 reference documentation}.
132
+ */
133
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'checkout_progress', eventParams?: {
67
134
  currency?: EventParams['currency'];
68
135
  coupon?: EventParams['coupon'];
69
136
  value?: EventParams['value'];
@@ -72,27 +139,72 @@ declare module "@firebase/analytics" {
72
139
  checkout_option?: EventParams['checkout_option'];
73
140
  [key: string]: any;
74
141
  }, options?: AnalyticsCallOptions): void;
75
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'exception', eventParams?: {
142
+ /**
143
+ * Sends a Google Analytics event with given `eventParams`. This method
144
+ * automatically associates this logged event with this Firebase web
145
+ * app instance on this device.
146
+ * @public
147
+ * See
148
+ * {@link https://developers.google.com/analytics/devguides/collection/ga4/exceptions
149
+ * | Measure exceptions}.
150
+ */
151
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'exception', eventParams?: {
76
152
  description?: EventParams['description'];
77
153
  fatal?: EventParams['fatal'];
78
154
  [key: string]: any;
79
155
  }, options?: AnalyticsCallOptions): void;
80
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'generate_lead', eventParams?: {
156
+ /**
157
+ * Sends a Google Analytics event with given `eventParams`. This method
158
+ * automatically associates this logged event with this Firebase web
159
+ * app instance on this device.
160
+ * @public
161
+ * List of recommended event parameters can be found in
162
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
163
+ * | the GA4 reference documentation}.
164
+ */
165
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'generate_lead', eventParams?: {
81
166
  value?: EventParams['value'];
82
167
  currency?: EventParams['currency'];
83
168
  [key: string]: any;
84
169
  }, options?: AnalyticsCallOptions): void;
85
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'login', eventParams?: {
170
+ /**
171
+ * Sends a Google Analytics event with given `eventParams`. This method
172
+ * automatically associates this logged event with this Firebase web
173
+ * app instance on this device.
174
+ * @public
175
+ * List of recommended event parameters can be found in
176
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
177
+ * | the GA4 reference documentation}.
178
+ */
179
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'login', eventParams?: {
86
180
  method?: EventParams['method'];
87
181
  [key: string]: any;
88
182
  }, options?: AnalyticsCallOptions): void;
89
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'page_view', eventParams?: {
183
+ /**
184
+ * Sends a Google Analytics event with given `eventParams`. This method
185
+ * automatically associates this logged event with this Firebase web
186
+ * app instance on this device.
187
+ * @public
188
+ * See
189
+ * {@link https://developers.google.com/analytics/devguides/collection/ga4/views
190
+ * | Page views}.
191
+ */
192
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'page_view', eventParams?: {
90
193
  page_title?: string;
91
194
  page_location?: string;
92
195
  page_path?: string;
93
196
  [key: string]: any;
94
197
  }, options?: AnalyticsCallOptions): void;
95
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'purchase' | 'refund', eventParams?: {
198
+ /**
199
+ * Sends a Google Analytics event with given `eventParams`. This method
200
+ * automatically associates this logged event with this Firebase web
201
+ * app instance on this device.
202
+ * @public
203
+ * List of recommended event parameters can be found in
204
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
205
+ * | the GA4 reference documentation}.
206
+ */
207
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'purchase' | 'refund', eventParams?: {
96
208
  value?: EventParams['value'];
97
209
  currency?: EventParams['currency'];
98
210
  transaction_id: EventParams['transaction_id'];
@@ -103,71 +215,211 @@ declare module "@firebase/analytics" {
103
215
  affiliation?: EventParams['affiliation'];
104
216
  [key: string]: any;
105
217
  }, options?: AnalyticsCallOptions): void;
106
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'screen_view', eventParams?: {
218
+ /**
219
+ * Sends a Google Analytics event with given `eventParams`. This method
220
+ * automatically associates this logged event with this Firebase web
221
+ * app instance on this device.
222
+ * @public
223
+ * See {@link https://firebase.google.com/docs/analytics/screenviews
224
+ * | Track Screenviews}.
225
+ */
226
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'screen_view', eventParams?: {
107
227
  firebase_screen: EventParams['firebase_screen'];
108
228
  firebase_screen_class: EventParams['firebase_screen_class'];
109
229
  [key: string]: any;
110
230
  }, options?: AnalyticsCallOptions): void;
111
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'search' | 'view_search_results', eventParams?: {
231
+ /**
232
+ * Sends a Google Analytics event with given `eventParams`. This method
233
+ * automatically associates this logged event with this Firebase web
234
+ * app instance on this device.
235
+ * @public
236
+ * List of recommended event parameters can be found in
237
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
238
+ * | the GA4 reference documentation}.
239
+ */
240
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'search' | 'view_search_results', eventParams?: {
112
241
  search_term?: EventParams['search_term'];
113
242
  [key: string]: any;
114
243
  }, options?: AnalyticsCallOptions): void;
115
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_content', eventParams?: {
244
+ /**
245
+ * Sends a Google Analytics event with given `eventParams`. This method
246
+ * automatically associates this logged event with this Firebase web
247
+ * app instance on this device.
248
+ * @public
249
+ * List of recommended event parameters can be found in
250
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
251
+ * | the GA4 reference documentation}.
252
+ */
253
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_content', eventParams?: {
116
254
  content_type?: EventParams['content_type'];
117
255
  item_id?: EventParams['item_id'];
118
256
  [key: string]: any;
119
257
  }, options?: AnalyticsCallOptions): void;
120
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_item', eventParams?: {
258
+ /**
259
+ * Sends a Google Analytics event with given `eventParams`. This method
260
+ * automatically associates this logged event with this Firebase web
261
+ * app instance on this device.
262
+ * @public
263
+ * List of recommended event parameters can be found in
264
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
265
+ * | the GA4 reference documentation}.
266
+ */
267
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_item', eventParams?: {
121
268
  items?: EventParams['items'];
122
269
  item_list_name?: EventParams['item_list_name'];
123
270
  item_list_id?: EventParams['item_list_id'];
124
271
  [key: string]: any;
125
272
  }, options?: AnalyticsCallOptions): void;
126
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_promotion' | 'view_promotion', eventParams?: {
273
+ /**
274
+ * Sends a Google Analytics event with given `eventParams`. This method
275
+ * automatically associates this logged event with this Firebase web
276
+ * app instance on this device.
277
+ * @public
278
+ * List of recommended event parameters can be found in
279
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
280
+ * | the GA4 reference documentation}.
281
+ */
282
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'select_promotion' | 'view_promotion', eventParams?: {
127
283
  items?: EventParams['items'];
128
284
  promotion_id?: EventParams['promotion_id'];
129
285
  promotion_name?: EventParams['promotion_name'];
130
286
  [key: string]: any;
131
287
  }, options?: AnalyticsCallOptions): void;
132
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'set_checkout_option', eventParams?: {
288
+ /**
289
+ * Sends a Google Analytics event with given `eventParams`. This method
290
+ * automatically associates this logged event with this Firebase web
291
+ * app instance on this device.
292
+ * @public
293
+ * List of recommended event parameters can be found in
294
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
295
+ * | the GA4 reference documentation}.
296
+ */
297
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'set_checkout_option', eventParams?: {
133
298
  checkout_step?: EventParams['checkout_step'];
134
299
  checkout_option?: EventParams['checkout_option'];
135
300
  [key: string]: any;
136
301
  }, options?: AnalyticsCallOptions): void;
137
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'share', eventParams?: {
302
+ /**
303
+ * Sends a Google Analytics event with given `eventParams`. This method
304
+ * automatically associates this logged event with this Firebase web
305
+ * app instance on this device.
306
+ * @public
307
+ * List of recommended event parameters can be found in
308
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
309
+ * | the GA4 reference documentation}.
310
+ */
311
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'share', eventParams?: {
138
312
  method?: EventParams['method'];
139
313
  content_type?: EventParams['content_type'];
140
314
  item_id?: EventParams['item_id'];
141
315
  [key: string]: any;
142
316
  }, options?: AnalyticsCallOptions): void;
143
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'sign_up', eventParams?: {
317
+ /**
318
+ * Sends a Google Analytics event with given `eventParams`. This method
319
+ * automatically associates this logged event with this Firebase web
320
+ * app instance on this device.
321
+ * @public
322
+ * List of recommended event parameters can be found in
323
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
324
+ * | the GA4 reference documentation}.
325
+ */
326
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'sign_up', eventParams?: {
144
327
  method?: EventParams['method'];
145
328
  [key: string]: any;
146
329
  }, options?: AnalyticsCallOptions): void;
147
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'timing_complete', eventParams?: {
330
+ /**
331
+ * Sends a Google Analytics event with given `eventParams`. This method
332
+ * automatically associates this logged event with this Firebase web
333
+ * app instance on this device.
334
+ * @public
335
+ * List of recommended event parameters can be found in
336
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
337
+ * | the GA4 reference documentation}.
338
+ */
339
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'timing_complete', eventParams?: {
148
340
  name: string;
149
341
  value: number;
150
342
  event_category?: string;
151
343
  event_label?: string;
152
344
  [key: string]: any;
153
345
  }, options?: AnalyticsCallOptions): void;
154
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'view_cart' | 'view_item', eventParams?: {
346
+ /**
347
+ * Sends a Google Analytics event with given `eventParams`. This method
348
+ * automatically associates this logged event with this Firebase web
349
+ * app instance on this device.
350
+ * @public
351
+ * List of recommended event parameters can be found in
352
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
353
+ * | the GA4 reference documentation}.
354
+ */
355
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'view_cart' | 'view_item', eventParams?: {
155
356
  currency?: EventParams['currency'];
156
357
  items?: EventParams['items'];
157
358
  value?: EventParams['value'];
158
359
  [key: string]: any;
159
360
  }, options?: AnalyticsCallOptions): void;
160
- function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'view_item_list', eventParams?: {
361
+ /**
362
+ * Sends a Google Analytics event with given `eventParams`. This method
363
+ * automatically associates this logged event with this Firebase web
364
+ * app instance on this device.
365
+ * @public
366
+ * List of recommended event parameters can be found in
367
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
368
+ * | the GA4 reference documentation}.
369
+ */
370
+ export declare function logEvent(analyticsInstance: FirebaseAnalytics, eventName: 'view_item_list', eventParams?: {
161
371
  items?: EventParams['items'];
162
372
  item_list_name?: EventParams['item_list_name'];
163
373
  item_list_id?: EventParams['item_list_id'];
164
374
  [key: string]: any;
165
375
  }, options?: AnalyticsCallOptions): void;
166
- function logEvent<T extends string>(analyticsInstance: FirebaseAnalytics, eventName: CustomEventName<T>, eventParams?: {
376
+ /**
377
+ * Sends a Google Analytics event with given `eventParams`. This method
378
+ * automatically associates this logged event with this Firebase web
379
+ * app instance on this device.
380
+ * @public
381
+ * List of recommended event parameters can be found in
382
+ * {@link https://developers.google.com/gtagjs/reference/ga4-events
383
+ * | the GA4 reference documentation}.
384
+ */
385
+ export declare function logEvent<T extends string>(analyticsInstance: FirebaseAnalytics, eventName: CustomEventName<T>, eventParams?: {
167
386
  [key: string]: any;
168
387
  }, options?: AnalyticsCallOptions): void;
169
- function setAnalyticsCollectionEnabled(analyticsInstance: FirebaseAnalytics, enabled: boolean): void;
170
- function setCurrentScreen(analyticsInstance: FirebaseAnalytics, screenName: string, options?: AnalyticsCallOptions): void;
171
- function setUserId(analyticsInstance: FirebaseAnalytics, id: string | null, options?: AnalyticsCallOptions): void;
172
- function setUserProperties(analyticsInstance: FirebaseAnalytics, properties: CustomParams, options?: AnalyticsCallOptions): void;
388
+ /**
389
+ * Sets whether Google Analytics collection is enabled for this app on this device.
390
+ * Sets global `window['ga-disable-analyticsId'] = true;`
391
+ *
392
+ * @public
393
+ *
394
+ * @param analyticsInstance - The {@link Analytics} instance.
395
+ * @param enabled - If true, enables collection, if false, disables it.
396
+ */
397
+ export declare function setAnalyticsCollectionEnabled(analyticsInstance: FirebaseAnalytics, enabled: boolean): void;
398
+ /**
399
+ * Use gtag `config` command to set `screen_name`.
400
+ *
401
+ * @public
402
+ *
403
+ * @deprecated Use {@link logEvent} with `eventName` as 'screen_view' and add relevant `eventParams`.
404
+ * See {@link https://firebase.google.com/docs/analytics/screenviews | Track Screenviews}.
405
+ *
406
+ * @param analyticsInstance - The {@link Analytics} instance.
407
+ * @param screenName - Screen name to set.
408
+ */
409
+ export declare function setCurrentScreen(analyticsInstance: FirebaseAnalytics, screenName: string, options?: AnalyticsCallOptions): void;
410
+ /**
411
+ * Use gtag `config` command to set `user_id`.
412
+ *
413
+ * @public
414
+ *
415
+ * @param analyticsInstance - The {@link Analytics} instance.
416
+ * @param id - User ID to set.
417
+ */
418
+ export declare function setUserId(analyticsInstance: FirebaseAnalytics, id: string | null, options?: AnalyticsCallOptions): void;
419
+ /**
420
+ * Use gtag `config` command to set all params specified.
421
+ *
422
+ * @public
423
+ */
424
+ export declare function setUserProperties(analyticsInstance: FirebaseAnalytics, properties: CustomParams, options?: AnalyticsCallOptions): void;
173
425
  }
@@ -1,33 +1,33 @@
1
- /**
2
- * @license
3
- * Copyright 2020 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, FirebaseAnalytics } from '@firebase/analytics-types';
18
- import { Analytics as AnalyticsServiceExp } from '@firebase/analytics';
19
- import { _FirebaseService, FirebaseApp } from '@firebase/app-compat';
20
- export declare class AnalyticsService implements FirebaseAnalytics, _FirebaseService {
21
- app: FirebaseApp;
22
- readonly _delegate: AnalyticsServiceExp;
23
- constructor(app: FirebaseApp, _delegate: AnalyticsServiceExp);
24
- logEvent(eventName: string, eventParams?: EventParams | CustomParams, options?: AnalyticsCallOptions): void;
25
- /**
26
- * @deprecated Use {@link logEvent} with `eventName` as 'screen_view' and add relevant `eventParams`.
27
- * See {@link https://firebase.google.com/docs/analytics/screenviews | Track Screenviews}.
28
- */
29
- setCurrentScreen(screenName: string, options?: AnalyticsCallOptions): void;
30
- setUserId(id: string, options?: AnalyticsCallOptions): void;
31
- setUserProperties(properties: CustomParams, options?: AnalyticsCallOptions): void;
32
- setAnalyticsCollectionEnabled(enabled: boolean): void;
33
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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, FirebaseAnalytics } from '@firebase/analytics-types';
18
+ import { Analytics as AnalyticsServiceExp } from '@firebase/analytics';
19
+ import { _FirebaseService, FirebaseApp } from '@firebase/app-compat';
20
+ export declare class AnalyticsService implements FirebaseAnalytics, _FirebaseService {
21
+ app: FirebaseApp;
22
+ readonly _delegate: AnalyticsServiceExp;
23
+ constructor(app: FirebaseApp, _delegate: AnalyticsServiceExp);
24
+ logEvent(eventName: string, eventParams?: EventParams | CustomParams, options?: AnalyticsCallOptions): void;
25
+ /**
26
+ * @deprecated Use {@link logEvent} with `eventName` as 'screen_view' and add relevant `eventParams`.
27
+ * See {@link https://firebase.google.com/docs/analytics/screenviews | Track Screenviews}.
28
+ */
29
+ setCurrentScreen(screenName: string, options?: AnalyticsCallOptions): void;
30
+ setUserId(id: string, options?: AnalyticsCallOptions): void;
31
+ setUserProperties(properties: CustomParams, options?: AnalyticsCallOptions): void;
32
+ setAnalyticsCollectionEnabled(enabled: boolean): void;
33
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/analytics-compat",
3
- "version": "0.2.15-canary.a97ac88db",
3
+ "version": "0.2.15-canary.e577a408c",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -19,14 +19,14 @@
19
19
  ],
20
20
  "license": "Apache-2.0",
21
21
  "peerDependencies": {
22
- "@firebase/app-compat": "0.2.44-canary.a97ac88db"
22
+ "@firebase/app-compat": "0.2.45-canary.e577a408c"
23
23
  },
24
24
  "devDependencies": {
25
- "@firebase/app-compat": "0.2.44-canary.a97ac88db",
25
+ "@firebase/app-compat": "0.2.45-canary.e577a408c",
26
26
  "rollup": "2.79.1",
27
27
  "@rollup/plugin-json": "4.1.0",
28
28
  "rollup-plugin-typescript2": "0.31.2",
29
- "typescript": "4.7.4"
29
+ "typescript": "5.5.4"
30
30
  },
31
31
  "repository": {
32
32
  "directory": "packages/analytics-compat",
@@ -52,10 +52,10 @@
52
52
  },
53
53
  "typings": "dist/src/index.d.ts",
54
54
  "dependencies": {
55
- "@firebase/component": "0.6.10-canary.a97ac88db",
56
- "@firebase/analytics": "0.10.9-canary.a97ac88db",
57
- "@firebase/analytics-types": "0.8.2-canary.a97ac88db",
58
- "@firebase/util": "1.10.1-canary.a97ac88db",
55
+ "@firebase/component": "0.6.10-canary.e577a408c",
56
+ "@firebase/analytics": "0.10.9-canary.e577a408c",
57
+ "@firebase/analytics-types": "0.8.2-canary.e577a408c",
58
+ "@firebase/util": "1.10.1-canary.e577a408c",
59
59
  "tslib": "^2.1.0"
60
60
  },
61
61
  "nyc": {