Skip to content

Conversation

GoodSir42
Copy link

Description

Motivation:
Since migrating from logScreenView to logging screen_view events we lost the screen tracking in our project. To prevent this from happening to other developers only the typing information has to be fixed.
Without the change developers are encouraged to use faulty parameter names, leading to errors in the firebase backend and dropped events due to reserved property names. If the names screen_name and screen class are used the issue does not exist and screen views are tracked as before via logScreenView

See issue #8609 for more details on this.

It is likely that the EventParams firebase_screen and firebase_screen_class are not needed any more.

Related issues

Fixes #8609

Release Summary

This changes the names you need to supply to logEvent(analytics, 'screen_view') to what it should have been already. Without a change to parameter names your screen tracking will not work!

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • [-] e2e tests added or updated in packages/\*\*/e2e
    • [-] jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes (it will require changes to the passed in parameters, but it is more fixing than breaking)
    • [-] No

Test Plan

I only changed typings and validated the change in my own Project since it requires checks on the firebase debugging backend.

And since I read the whole guide I am allowed to add some flames in the end :) 🔥

@CLAassistant
Copy link

CLAassistant commented Sep 3, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-native-firebase Ready Ready Preview Comment Sep 17, 2025 11:21am

firebase_screen: EventParams['firebase_screen'];
firebase_screen_class: EventParams['firebase_screen_class'];
screen_name: EventParams['firebase_screen'];
screen_class: EventParams['firebase_screen_class'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these meant to be EventParams['screen_name'] and EventParams['screen_class']?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, only one of those exists in @react-native-firebase/analytics/lib/index.d.ts:

export interface EventParams {
    //...
    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;
    //...
}

Should one of these not exist?

Copy link
Author

@GoodSir42 GoodSir42 Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the logs/FB console on the web anything prefixed with firebase should not be used as a parameter since they are internal. SO yes. I think it should be screen_name and screen_class and the firebase_screen and firebase_screen_class should be removed. I just left them in to be checked by someone with deeper knowledge of why they have been put in in the first place.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liamjones can I see the thumbs up as a hint to remove the firebase_ prefixed properties or is it a plus one for the need for somebody else to look into it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoodSir42 Ah, apologies for the ambiguity. It definitely needs to be without the firebase_ prefix.

If you enable GA's DebugView and log an event using firebase_screen_view it'll show an error:

image

Error 14 is "Event parameter name is reserved" (see https://firebase.google.com/docs/analytics/errors) and error_value is set to firebase_screen_name.

If you use screen_view DebugView will show it under firebase_screen and there is no error:

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was my original lead. I'll update the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛] logEvent versus logScreenView
3 participants