-
Notifications
You must be signed in to change notification settings - Fork 2.3k
RNSScreen in analytics events #7247
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 2
Replies: 4 comments 5 replies
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
I have the same issue. Any updates on this ? 🙏
Beta Was this translation helpful? Give feedback.
All reactions
-
Were any of you able to find a fix for this? @thomasblom @Panda-ref @Romaric-CH @mikehardy
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm trying out and seeing if stopping the automatic screen tracking might fix it. Credit: https://stackoverflow.com/questions/61056541/how-to-remove-mainactivity-and-uiviewcontroller-from-screen-tracking-in-react-na/74313385#74313385.
Beta Was this translation helpful? Give feedback.
All reactions
-
This solution fix that ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh sorry I forget about updating, yes it did!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.