How do I set up a GA4 property for a mobile app using Firebase?
Applies to: Google Analytics 4 (GA4), Firebase, iOS and Android apps
Last updated: May 2025
Problem
You want to track user behavior and events in a mobile app using Google Analytics 4, but GA4 for apps is set up through Firebase, not directly through the GA4 interface.
Solution
To use GA4 for a mobile app, you must create a Firebase project, link it to GA4, and integrate the Firebase SDK into your iOS or Android app. Firebase will automatically collect core analytics data and allow you to log custom events.
Step-by-Step Guide
Step 1: Create a Firebase Project
- Go to https://console.firebase.google.com
- Click Add project
- Enter a project name (e.g.,
MyApp Analytics) - Follow the setup flow and accept the terms
- Once the project is created, click Continue
Step 2: Add Your Mobile App
- In Firebase, click the iOS or Android icon to begin setup
- Follow the steps to register your app:
- For Android: Enter the package name
- For iOS: Enter the iOS bundle ID
- Download the google-services.json (Android) or GoogleService-Info.plist (iOS)
- Add the config file to your app’s project folder
Step 3: Add Firebase SDK to Your App
Android (Kotlin/Java):
- Add Firebase SDK to your app-level
build.gradle:
dependencies {
implementation 'com.google.firebase:firebase-analytics'
}
- Sync the project and run the app
iOS (Swift/Obj-C):
- Use CocoaPods to install Firebase Analytics:
pod 'Firebase/Analytics'
- Import Firebase and initialize it in your
AppDelegate:
import Firebase
FirebaseApp.configure()
Step 4: Enable GA4 Analytics
- In Firebase Console, go to Project Settings > Integrations
- Find Google Analytics and click Link
- Either:
- Create a new GA4 property, or
- Link to an existing GA4 property
- Enable data sharing and proceed
Now your Firebase project will send app analytics data to the GA4 property automatically.
Step 5: View App Data in GA4
- Go to https://analytics.google.com
- Select the linked GA4 property
- Go to Reports > Realtime or Reports > Engagement > Events to see mobile app activity
Key Features Automatically Tracked
- First opens
- App updates
- In-app purchases
- Screen views
- Session starts
- Crashes (if Crashlytics is enabled)
Custom Event Logging (Optional)
In your app, you can log custom events like this:
Android:
val params = Bundle()
params.putString("screen_type", "onboarding")
FirebaseAnalytics.getInstance(this).logEvent("custom_event", params)
iOS:
Analytics.logEvent("custom_event", parameters: [
"screen_type": "onboarding"
])
These events will appear in GA4 once sent and can be marked as conversions or used in reports.
Notes
- It may take several hours for app data to appear in standard reports (Realtime is faster)
- Firebase allows linking with BigQuery for deeper mobile analytics
- No separate tag setup is required—Firebase handles the data collection




