Skip to content

Commit bd50d83

Browse files
authored
Fix links and update event typings (#5206)
1 parent 2493c17 commit bd50d83

File tree

7 files changed

+231
-269
lines changed

7 files changed

+231
-269
lines changed

.changeset/wise-forks-poke.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@firebase/analytics-interop-types': minor
3+
'@firebase/analytics-types': minor
4+
'firebase': minor
5+
---
6+
7+
Fix formatting of links in comments and update some event typings to correctly match GA4 specs.

packages-exp/analytics-exp/src/api.ts

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ export function setAnalyticsCollectionEnabled(
221221
* app instance on this device.
222222
* @public
223223
* List of recommended event parameters can be found in
224-
* {@link https://developers.google.com/gtagjs/reference/event
225-
* | the gtag.js reference documentation}.
224+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
225+
* | the GA4 reference documentation}.
226226
*/
227227
export function logEvent(
228228
analyticsInstance: Analytics,
@@ -244,8 +244,8 @@ export function logEvent(
244244
* app instance on this device.
245245
* @public
246246
* List of recommended event parameters can be found in
247-
* {@link https://developers.google.com/gtagjs/reference/event
248-
* | the gtag.js reference documentation}.
247+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
248+
* | the GA4 reference documentation}.
249249
*/
250250
export function logEvent(
251251
analyticsInstance: Analytics,
@@ -267,8 +267,8 @@ export function logEvent(
267267
* app instance on this device.
268268
* @public
269269
* List of recommended event parameters can be found in
270-
* {@link https://developers.google.com/gtagjs/reference/event
271-
* | the gtag.js reference documentation}.
270+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
271+
* | the GA4 reference documentation}.
272272
*/
273273
export function logEvent(
274274
analyticsInstance: Analytics,
@@ -288,8 +288,8 @@ export function logEvent(
288288
* app instance on this device.
289289
* @public
290290
* List of recommended event parameters can be found in
291-
* {@link https://developers.google.com/gtagjs/reference/event
292-
* | the gtag.js reference documentation}.
291+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
292+
* | the GA4 reference documentation}.
293293
*/
294294
export function logEvent(
295295
analyticsInstance: Analytics,
@@ -310,8 +310,8 @@ export function logEvent(
310310
* app instance on this device.
311311
* @public
312312
* List of recommended event parameters can be found in
313-
* {@link https://developers.google.com/gtagjs/reference/event
314-
* | the gtag.js reference documentation}.
313+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
314+
* | the GA4 reference documentation}.
315315
*/
316316
export function logEvent(
317317
analyticsInstance: Analytics,
@@ -333,9 +333,9 @@ export function logEvent(
333333
* automatically associates this logged event with this Firebase web
334334
* app instance on this device.
335335
* @public
336-
* List of recommended event parameters can be found in
337-
* {@link https://developers.google.com/gtagjs/reference/event
338-
* | the gtag.js reference documentation}.
336+
* See
337+
* {@link https://developers.google.com/analytics/devguides/collection/ga4/exceptions
338+
* | Measure exceptions}.
339339
*/
340340
export function logEvent(
341341
analyticsInstance: Analytics,
@@ -354,16 +354,15 @@ export function logEvent(
354354
* app instance on this device.
355355
* @public
356356
* List of recommended event parameters can be found in
357-
* {@link https://developers.google.com/gtagjs/reference/event
358-
* | the gtag.js reference documentation}.
357+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
358+
* | the GA4 reference documentation}.
359359
*/
360360
export function logEvent(
361361
analyticsInstance: Analytics,
362362
eventName: 'generate_lead',
363363
eventParams?: {
364364
value?: EventParams['value'];
365365
currency?: EventParams['currency'];
366-
transaction_id?: EventParams['transaction_id'];
367366
[key: string]: any;
368367
},
369368
options?: AnalyticsCallOptions
@@ -375,8 +374,8 @@ export function logEvent(
375374
* app instance on this device.
376375
* @public
377376
* List of recommended event parameters can be found in
378-
* {@link https://developers.google.com/gtagjs/reference/event
379-
* | the gtag.js reference documentation}.
377+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
378+
* | the GA4 reference documentation}.
380379
*/
381380
export function logEvent(
382381
analyticsInstance: Analytics,
@@ -393,9 +392,9 @@ export function logEvent(
393392
* automatically associates this logged event with this Firebase web
394393
* app instance on this device.
395394
* @public
396-
* List of recommended event parameters can be found in
397-
* {@link https://developers.google.com/gtagjs/reference/event
398-
* | the gtag.js reference documentation}.
395+
* See
396+
* {@link https://developers.google.com/analytics/devguides/collection/ga4/page-view
397+
* | Page views}.
399398
*/
400399
export function logEvent(
401400
analyticsInstance: Analytics,
@@ -415,8 +414,8 @@ export function logEvent(
415414
* app instance on this device.
416415
* @public
417416
* List of recommended event parameters can be found in
418-
* {@link https://developers.google.com/gtagjs/reference/event
419-
* | the gtag.js reference documentation}.
417+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
418+
* | the GA4 reference documentation}.
420419
*/
421420
export function logEvent(
422421
analyticsInstance: Analytics,
@@ -440,21 +439,15 @@ export function logEvent(
440439
* automatically associates this logged event with this Firebase web
441440
* app instance on this device.
442441
* @public
443-
* List of recommended event parameters can be found in
444-
* {@link https://developers.google.com/gtagjs/reference/event
445-
* | the gtag.js reference documentation}.
442+
* See {@link https://firebase.google.com/docs/analytics/screenviews
443+
* | Track Screenviews}.
446444
*/
447445
export function logEvent(
448446
analyticsInstance: Analytics,
449447
eventName: 'screen_view',
450448
eventParams?: {
451-
app_name: string;
452-
screen_name: EventParams['screen_name'];
453449
firebase_screen: EventParams['firebase_screen'];
454450
firebase_screen_class: EventParams['firebase_screen_class'];
455-
app_id?: string;
456-
app_version?: string;
457-
app_installer_id?: string;
458451
[key: string]: any;
459452
},
460453
options?: AnalyticsCallOptions
@@ -466,8 +459,8 @@ export function logEvent(
466459
* app instance on this device.
467460
* @public
468461
* List of recommended event parameters can be found in
469-
* {@link https://developers.google.com/gtagjs/reference/event
470-
* | the gtag.js reference documentation}.
462+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
463+
* | the GA4 reference documentation}.
471464
*/
472465
export function logEvent(
473466
analyticsInstance: Analytics,
@@ -485,17 +478,15 @@ export function logEvent(
485478
* app instance on this device.
486479
* @public
487480
* List of recommended event parameters can be found in
488-
* {@link https://developers.google.com/gtagjs/reference/event
489-
* | the gtag.js reference documentation}.
481+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
482+
* | the GA4 reference documentation}.
490483
*/
491484
export function logEvent(
492485
analyticsInstance: Analytics,
493486
eventName: 'select_content',
494487
eventParams?: {
495-
items?: EventParams['items'];
496-
promotions?: EventParams['promotions'];
497488
content_type?: EventParams['content_type'];
498-
content_id?: EventParams['content_id'];
489+
item_id?: EventParams['item_id'];
499490
[key: string]: any;
500491
},
501492
options?: AnalyticsCallOptions
@@ -507,8 +498,8 @@ export function logEvent(
507498
* app instance on this device.
508499
* @public
509500
* List of recommended event parameters can be found in
510-
* {@link https://developers.google.com/gtagjs/reference/event
511-
* | the gtag.js reference documentation}.
501+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
502+
* | the GA4 reference documentation}.
512503
*/
513504
export function logEvent(
514505
analyticsInstance: Analytics,
@@ -528,8 +519,8 @@ export function logEvent(
528519
* app instance on this device.
529520
* @public
530521
* List of recommended event parameters can be found in
531-
* {@link https://developers.google.com/gtagjs/reference/event
532-
* | the gtag.js reference documentation}.
522+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
523+
* | the GA4 reference documentation}.
533524
*/
534525
export function logEvent(
535526
analyticsInstance: Analytics,
@@ -549,8 +540,8 @@ export function logEvent(
549540
* app instance on this device.
550541
* @public
551542
* List of recommended event parameters can be found in
552-
* {@link https://developers.google.com/gtagjs/reference/event
553-
* | the gtag.js reference documentation}.
543+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
544+
* | the GA4 reference documentation}.
554545
*/
555546
export function logEvent(
556547
analyticsInstance: Analytics,
@@ -569,16 +560,16 @@ export function logEvent(
569560
* app instance on this device.
570561
* @public
571562
* List of recommended event parameters can be found in
572-
* {@link https://developers.google.com/gtagjs/reference/event
573-
* | the gtag.js reference documentation}.
563+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
564+
* | the GA4 reference documentation}.
574565
*/
575566
export function logEvent(
576567
analyticsInstance: Analytics,
577568
eventName: 'share',
578569
eventParams?: {
579570
method?: EventParams['method'];
580571
content_type?: EventParams['content_type'];
581-
content_id?: EventParams['content_id'];
572+
item_id?: EventParams['item_id'];
582573
[key: string]: any;
583574
},
584575
options?: AnalyticsCallOptions
@@ -590,8 +581,8 @@ export function logEvent(
590581
* app instance on this device.
591582
* @public
592583
* List of recommended event parameters can be found in
593-
* {@link https://developers.google.com/gtagjs/reference/event
594-
* | the gtag.js reference documentation}.
584+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
585+
* | the GA4 reference documentation}.
595586
*/
596587
export function logEvent(
597588
analyticsInstance: Analytics,
@@ -609,8 +600,8 @@ export function logEvent(
609600
* app instance on this device.
610601
* @public
611602
* List of recommended event parameters can be found in
612-
* {@link https://developers.google.com/gtagjs/reference/event
613-
* | the gtag.js reference documentation}.
603+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
604+
* | the GA4 reference documentation}.
614605
*/
615606
export function logEvent(
616607
analyticsInstance: Analytics,
@@ -631,8 +622,8 @@ export function logEvent(
631622
* app instance on this device.
632623
* @public
633624
* List of recommended event parameters can be found in
634-
* {@link https://developers.google.com/gtagjs/reference/event
635-
* | the gtag.js reference documentation}.
625+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
626+
* | the GA4 reference documentation}.
636627
*/
637628
export function logEvent(
638629
analyticsInstance: Analytics,
@@ -652,8 +643,8 @@ export function logEvent(
652643
* app instance on this device.
653644
* @public
654645
* List of recommended event parameters can be found in
655-
* {@link https://developers.google.com/gtagjs/reference/event
656-
* | the gtag.js reference documentation}.
646+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
647+
* | the GA4 reference documentation}.
657648
*/
658649
export function logEvent(
659650
analyticsInstance: Analytics,
@@ -673,8 +664,8 @@ export function logEvent(
673664
* app instance on this device.
674665
* @public
675666
* List of recommended event parameters can be found in
676-
* {@link https://developers.google.com/gtagjs/reference/event
677-
* | the gtag.js reference documentation}.
667+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
668+
* | the GA4 reference documentation}.
678669
*/
679670
export function logEvent<T extends string>(
680671
analyticsInstance: Analytics,
@@ -689,8 +680,8 @@ export function logEvent<T extends string>(
689680
* app instance on this device.
690681
* List of official event parameters can be found in the gtag.js
691682
* reference documentation:
692-
* {@link https://developers.google.com/gtagjs/reference/event
693-
* | the gtag.js reference documentation}.
683+
* {@link https://developers.google.com/gtagjs/reference/ga4-events
684+
* | the GA4 reference documentation}.
694685
*
695686
* @public
696687
*/

0 commit comments

Comments
 (0)