Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RNSScreen in analytics events #7247

Unanswered
thomasblom asked this question in Q&A
Jul 18, 2023 · 4 comments · 5 replies
Discussion options

I'm using @react-native-firebase/analytics in combination with react-native-screens . In every event there is a property firebase_screen_class that contains the current classname of the screen.
By default react-native-screens sets this property as RNSScreen, but i change the value with analytics().logScreenView(...).
After a couple of events it changes back to RNSScreen and i'm not sure where that happens..

Does anyone know more about this value and where it comes from and how it resets to the initial value?

Thanks in advance!

You must be logged in to vote

Replies: 4 comments 5 replies

Comment options

Happens to us as well. Mostly happens on iOS.

const handleNavigationStateChange = useCallback(async () => {
 const previousRouteName = routeNameRef.current;
 const currentRouteName = navigationRef.current.getCurrentRoute().name;
 if (previousRouteName !== currentRouteName) {
 await logScreenView({
 screen_name: currentRouteName,
 screen_class: currentRouteName,
 });
 }
 routeNameRef.current = currentRouteName;
 }, []);

Always keeping the @react-native-firebase/* packages up to date with dependabot.
@mikehardy Is there any recommendations on how to avoid that or what can cause it?

You must be logged in to vote
0 replies
Comment options

I have the same issue. Any updates on this ? 🙏

You must be logged in to vote
0 replies
Comment options

Were any of you able to find a fix for this? @thomasblom @Panda-ref @Romaric-CH @mikehardy

You must be logged in to vote
5 replies
Comment options

Comment options

This solution fix that ?

Comment options

Oh sorry I forget about updating, yes it did!

Comment options

hi @ammaarkhan , did this solution mean that those values are set as not set in the firebase dashboard?
Screenshot 2024年11月10日 at 14 24 30

Comment options

hey. I'm sorry unfortunately I cannot recall exactly. I stopped working on apps early this year so I haven't been looking at it.

Comment options

Bumping this, can someone please respond to confirm if this is still the right way to disable RNSScreen, UIViewController, MainActivity from appearing in Google Analytics ?
https://rnfirebase.io/analytics/usage#disable-screenview-tracking

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /