Skip to content

Commit

Permalink
Add firebase-specific screen_view params to Analytics (#5070)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored Jul 16, 2021
1 parent 4cb5d8a commit 02586c9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/nasty-hats-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@firebase/analytics-types': minor
'firebase': minor
---

Add `firebase_screen` and `firebase_screen_class` to `logEvent()` overload for `screen_view` events.
4 changes: 4 additions & 0 deletions common/api-review/analytics-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface EventParams {
event_label?: string;
// (undocumented)
fatal?: boolean;
firebase_screen?: string;
firebase_screen_class?: string;
// (undocumented)
item_list_id?: string;
// (undocumented)
Expand Down Expand Up @@ -295,6 +297,8 @@ export function logEvent(analyticsInstance: Analytics, eventName: 'purchase' | '
export function logEvent(analyticsInstance: Analytics, eventName: 'screen_view', eventParams?: {
app_name: string;
screen_name: EventParams['screen_name'];
firebase_screen: EventParams['firebase_screen'];
firebase_screen_class: EventParams['firebase_screen_class'];
app_id?: string;
app_version?: string;
app_installer_id?: string;
Expand Down
2 changes: 2 additions & 0 deletions packages-exp/analytics-exp/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ export function logEvent(
eventParams?: {
app_name: string;
screen_name: EventParams['screen_name'];
firebase_screen: EventParams['firebase_screen'];
firebase_screen_class: EventParams['firebase_screen_class'];
app_id?: string;
app_version?: string;
app_installer_id?: string;
Expand Down
8 changes: 8 additions & 0 deletions packages-exp/analytics-exp/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ export interface EventParams {
number?: string;
promotions?: Promotion[];
screen_name?: string;
/**
* Firebase-specific. Use to log a `screen_name` to Firebase Analytics.
*/
firebase_screen?: string;
/**
* Firebase-specific. Use to log a `screen_class` to Firebase Analytics.
*/
firebase_screen_class?: string;
search_term?: string;
shipping?: Currency;
tax?: Currency;
Expand Down
10 changes: 10 additions & 0 deletions packages/analytics-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ export interface FirebaseAnalytics {
eventParams?: {
app_name: string;
screen_name: EventParams['screen_name'];
firebase_screen: EventParams['firebase_screen'];
firebase_screen_class: EventParams['firebase_screen_class'];
app_id?: string;
app_version?: string;
app_installer_id?: string;
Expand Down Expand Up @@ -546,6 +548,14 @@ export interface EventParams {
number?: string;
promotions?: Promotion[];
screen_name?: string;
/**
* Firebase-specific. Use to log a `screen_name` to Firebase Analytics.
*/
firebase_screen?: string;
/**
* Firebase-specific. Use to log a `screen_class` to Firebase Analytics.
*/
firebase_screen_class?: string;
search_term?: string;
shipping?: Currency;
tax?: Currency;
Expand Down
10 changes: 10 additions & 0 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4859,6 +4859,8 @@ declare namespace firebase.analytics {
eventParams?: {
app_name: string;
screen_name: EventParams['screen_name'];
firebase_screen: EventParams['firebase_screen'];
firebase_screen_class: EventParams['firebase_screen_class'];
app_id?: string;
app_version?: string;
app_installer_id?: string;
Expand Down Expand Up @@ -5167,6 +5169,14 @@ declare namespace firebase.analytics {
number?: string;
promotions?: Promotion[];
screen_name?: string;
/**
* Firebase-specific. Use to log a `screen_name` to Firebase Analytics.
*/
firebase_screen?: string;
/**
* Firebase-specific. Use to log a `screen_class` to Firebase Analytics.
*/
firebase_screen_class?: string;
search_term?: string;
shipping?: Currency;
tax?: Currency;
Expand Down

0 comments on commit 02586c9

Please sign in to comment.