Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove MainActivity and UIViewController from screen tracking in React Native Firebase Analytics?

I have successfully implemented screen tracking for a react native project that uses react-navigation with react-native-firebase/analytics.

Looking at the dashboard under events I see the following events (image below). As you can see the top 2 events are automatically tracked 1. MainActivity, 2. UIViewController and they take up most of the total. I would like to remove those screens from the tracking to only show the screens of the JS side of the app (react-navigation).

Is this possible? How can I achieve this?

Thank you in advance πŸ™ŒπŸ»β€οΈπŸ€ΈπŸ»β€β™‚οΈ

Screenshot of screen tracking

like image 605
Hugo Pretorius Avatar asked Apr 06 '20 09:04

Hugo Pretorius


1 Answers

Analytics.setCurrentScreen(, ) will override the Screen class of the native MainActivity and UIViewController.

I recommend setting this as soon as possible when your app starts up, perhaps even on the splash screen. This way it will minimize the Avg. time spent on the native screens and over time they will go down to the bottom of the list.

There is currently no option to disable those screens from being tracked

like image 57
Hugo Pretorius Avatar answered Oct 08 '22 11:10

Hugo Pretorius