1. Introduction
Firebase Analytics (now called Google Analytics for Firebase) is a free, event-based analytics tool provided by Google. It helps track user behavior, engagement, and app performance in real-time.
In React Native, it allows us to:
-
-
-
Track screen visits
-
Capture button clicks / feature usage
-
Analyze user journeys
-
Collect custom events for business insights
-
-
2. Installation
Step 1: Install dependencies
or
Step 2: Setup Firebase Project
-
Go to Firebase Console.
-
Create a new project (or use existing).
-
Add your Android & iOS apps.
-
Download and place:
-
google-services.json
→ inandroid/app/
-
GoogleService-Info.plist
→ inios/
project root
-
Step 3: Configure Native Files
Android
-
In
android/build.gradle
-
In
android/app/build.gradle
iOS
-
Run:
3. Basic Usage
Import Analytics
Log Events
Track Screen Views
import { useEffect } from ‘react’;
import { useNavigationState } from ‘@react-navigation/native’;
import analytics from ‘@react-native-firebase/analytics’;
const useScreenTracking = () => {
const routeName = useNavigationState(state => state.routes[state.index].name);
useEffect(() => {
if (routeName) {
analytics().logScreenView({
screen_name: routeName,
screen_class: routeName,
});
}
}, [routeName]);
};
export default useScreenTracking;
4. Debugging Analytics
Enable Debug Mode
For Android:
For iOS:
Check events in DebugView (Firebase Console → Analytics → DebugView).
Analytics Result

Conclusion
Firebase Analytics in React Native provides a powerful, free, and reliable way to track user behavior, measure engagement, and evaluate app performance. By setting up standard events, adding custom tracking for key actions, and leveraging DebugView during development, teams can ensure accurate insights without slowing down the app. When combined with Crashlytics and other Firebase services, it becomes a complete solution for monitoring app health and user journeys.