
Table of Contents
ToggleIf you build a mobile app and do not track what users do inside it, you are guessing. Google Analytics for Firebase is free, works on iOS and Android, and sends your app data into Google Analytics 4 (GA4). Installing it is easy. Setting it up so the data is clean and usable is where most teams struggle.
This guide walks through the full firebase analytics setup for mobile apps: creating the project, installing the SDK, custom events, user properties, GA4, validation and BigQuery. It follows the current Firebase and Google Analytics documentation as of October 2026.
In this guide you will learn:
Firebase Analytics (officially Google Analytics for Firebase) is Google’s free app measurement SDK. It collects user behavior from your app and reports it in your GA4 property and in the Firebase console.
For many app teams, Firebase is the base analytics layer. Tools such as AppsFlyer, Adjust or RevenueCat sit next to it for install attribution and revenue, which I cover near the end of this guide.
You add the Firebase SDK to your app. After that, it does the following:
Data flow:
App with Firebase SDK → GA4 property → Firebase console and GA4 reports → optional BigQuery exportCheck these requirements before you start. They come from the current Firebase setup guides:
Requirements change with releases, so confirm them in the official Android setup guide and iOS setup guide before you update a production app.
You need a Firebase project before you install anything.
Important: use separate Firebase projects for development and production. If test events land in your production property, they mix with real user data and are hard to separate later.
Project-level build.gradle.kts (keep your existing plugin lines and add the last one):
plugins {
// your existing plugins stay here
id("com.google.gms.google-services") version "4.5.0" apply false
}App-level build.gradle.kts:
plugins {
id("com.android.application")
id("com.google.gms.google-services")
}
dependencies {
implementation(platform("com.google.firebase:firebase-bom:35.1.0"))
implementation("com.google.firebase:firebase-analytics")
}If your project still uses Groovy build.gradle files, the same lines use single quotes, for example id 'com.google.gms.google-services' version '4.5.0' apply false and implementation platform('com.google.firebase:firebase-bom:35.1.0').
You do not set a version on firebase-analytics because the BoM manages it. Version numbers move quickly, so check the Android setup guide for the current ones. Kotlin developers no longer need the KTX modules and should use the main modules, as shown above.
In Xcode, choose File, then Add Packages. Enter https://github.com/firebase/firebase-ios-sdk, keep the recommended version rule, and select FirebaseAnalytics.
Do not start a new project on CocoaPods. According to Firebase’s CocoaPods notice, Firebase stops publishing new versions to CocoaPods in October 2026, and the CocoaPods registry becomes read-only in December 2026. Existing versions keep working, but new Firebase releases will not reach CocoaPods. If you already have a Podfile, plan the move to Swift Package Manager and do not mix both methods in the same target.
On Android, Firebase starts through the Google services plugin. You only need the Analytics instance when you log events yourself:
import com.google.firebase.Firebase
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.analytics
class MainActivity : AppCompatActivity() {
private lateinit var analytics: FirebaseAnalytics
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analytics = Firebase.analytics
}
}Firebase’s iOS guide uses an app delegate attached to your App struct:
import SwiftUI
import FirebaseCore
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}
}
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Once Firebase is configured, automatic events start collecting without extra code.
These need no code once the SDK is installed. See Google’s list of automatically collected events for the full set.
| Event | When it fires |
|---|---|
| first_open | First launch after install or reinstall |
| session_start | A user engages the app and a session begins |
| screen_view | The screen name, class or ID changes from the previous one |
| user_engagement | The app is in the foreground for at least one second |
| app_update | The app is updated and relaunched |
| os_update | The device operating system is updated |
| in_app_purchase | A store purchase completes (needs the Firebase SDK) |
Some events are platform specific. For example, app_remove and app_clear_data are Android only.
Automatic events are not enough for real insight. Log the actions that matter to your business.
Android (Kotlin):
// User signs up
val signUp = Bundle()
signUp.putString(FirebaseAnalytics.Param.METHOD, "email")
analytics.logEvent(FirebaseAnalytics.Event.SIGN_UP, signUp)
// Purchase
val purchase = Bundle()
purchase.putDouble(FirebaseAnalytics.Param.VALUE, 29.99)
purchase.putString(FirebaseAnalytics.Param.CURRENCY, "USD")
purchase.putString(FirebaseAnalytics.Param.TRANSACTION_ID, "txn_12345")
analytics.logEvent(FirebaseAnalytics.Event.PURCHASE, purchase)
// Custom event
val custom = Bundle()
custom.putString("plan_type", "premium")
custom.putString("source", "onboarding")
analytics.logEvent("subscription_started", custom)iOS (Swift):
import FirebaseAnalytics
// User signs up
Analytics.logEvent(AnalyticsEventSignUp, parameters: [
AnalyticsParameterMethod: "email"
])
// Purchase
Analytics.logEvent(AnalyticsEventPurchase, parameters: [
AnalyticsParameterValue: 29.99,
AnalyticsParameterCurrency: "USD",
AnalyticsParameterTransactionID: "txn_12345"
])
// Custom event
Analytics.logEvent("subscription_started", parameters: [
"plan_type": "premium",
"source": "onboarding"
])Google lists these in its event collection limits:
User properties let you segment users by attributes such as plan type or language.
Android (Kotlin):
analytics.setUserProperty("subscription_type", "premium")
analytics.setUserProperty("user_tier", "enterprise")
analytics.setUserId("user_12345")iOS (Swift):
Analytics.setUserProperty("premium", forName: "subscription_type")
Analytics.setUserProperty("enterprise", forName: "user_tier")
Analytics.setUserID("user_12345")Limits to remember: 25 user properties per property, property names up to 24 characters, values up to 36 characters, and user IDs up to 256 characters.
Important: never send personally identifiable information such as an email address, phone number or full name as a user property, event parameter or user ID. Google Analytics terms prohibit it, and it creates GDPR risk. Use an internal anonymous ID instead.
When you keep Google Analytics enabled in Step 1, your project is linked to a GA4 property from the start. If you skipped it, open Project settings in the Firebase console, go to Integrations, and link a GA4 property there.
Once linked:
To verify, open your GA4 property, go to Admin, then Data streams. You should see your iOS and Android app streams. Reports are not instant: according to Google’s data freshness guide, intraday data takes about 2 to 6 hours, daily data about 12 hours, and processing can take 24 to 48 hours.
Never assume your tracking works. Test it before release with DebugView.
adb shell setprop debug.firebase.analytics.app com.yourpackage.nameTo turn it off again:
adb shell setprop debug.firebase.analytics.app .none.In Xcode, edit your scheme and add this to Arguments Passed On Launch:
-FIRDebugEnabledUse -FIRDebugDisabled to turn it off.
In the Firebase console, open Analytics, then DebugView, and trigger events on your test device. You will see them arrive as they are sent.
Events sent in debug mode are included in the daily BigQuery export by default. To keep test traffic out of your reports and exports, set up a developer traffic data filter in your Analytics property.
For advanced analysis, export raw Firebase data to BigQuery. Per Firebase’s BigQuery linking guide:
What to know before you link:
Test events mix with real data and are hard to remove later. Use separate Firebase projects, or at least filter developer traffic.
Without setUserId(), you cannot connect one person’s activity across sessions and devices. Set an anonymous ID right after login.
Emails, phone numbers and names do not belong in event parameters or user properties. Use anonymous IDs only.
The limit is 500 distinct event names per app. Plan an event list first and use parameters instead of a new event for every small action.
Many teams ship events they never saw arrive. Validate each event in DebugView before release.
Realtime and DebugView are fast. Standard reports can take hours, and processing can take up to 48 hours. Do not change your setup just because yesterday’s numbers are still moving.
New Firebase releases stop reaching CocoaPods after October 2026. Move your iOS project to Swift Package Manager so you keep receiving SDK updates.
Firebase alone does not tell you which ad or campaign brought each install. A complete measurement stack usually combines several tools:
| Tool | Purpose |
|---|---|
| Firebase Analytics | In-app behavior tracking |
| AppsFlyer, Adjust, Branch or Singular | Install attribution and campaign tracking |
| RevenueCat | Subscription and revenue tracking |
| Amplitude, Mixpanel or PostHog | Product analytics |
| GA4 | Cross-platform reporting |
If you are choosing an attribution tool, read my AppsFlyer vs Adjust comparison. To set one up, follow the AppsFlyer setup guide. If the basics are new to you, start with what mobile attribution is. To inspect the payloads these tools send, use the free mobile attribution debugger.
Firebase Analytics, now called Google Analytics for Firebase, tracks what users do inside your iOS and Android app. It records automatic events such as first_open and session_start, plus custom events like sign-ups and purchases, and reports them in your GA4 property and the Firebase console.
Yes, Google Analytics for Firebase is free to use. Costs can appear on other Google services you link to it, such as BigQuery storage, streaming inserts and queries beyond the free sandbox.
DebugView and the Realtime report show events within minutes. Standard GA4 reports are slower: intraday data takes about 2 to 6 hours, daily data about 12 hours, and processing can take up to 24 to 48 hours, during which numbers may still change.
Yes. Firebase tracks in-app behavior, while AppsFlyer or Adjust handles install attribution and campaign data. Teams commonly run them side by side. Check each platform’s integration guide if you want to pass data between them.
Firebase Analytics is the SDK in your app and the reports inside the Firebase console. GA4 is the Google Analytics property where the same app data is stored and analyzed. Once your Firebase project is linked to a GA4 property, both show the same events.
Log the standard purchase event with the value, currency and transaction_id parameters. GA4 recognizes this event name. Store purchases made through the App Store or Google Play are also collected automatically as in_app_purchase when the Firebase SDK is installed.
On Android, run adb shell setprop debug.firebase.analytics.app with your package name. On iOS, add -FIRDebugEnabled to the Arguments Passed On Launch in your Xcode scheme. Then open Analytics and DebugView in the Firebase console.
Use Swift Package Manager. According to Firebase, it stops publishing new versions to CocoaPods in October 2026 and the CocoaPods registry becomes read-only in December 2026. Existing versions keep working, but new Firebase releases will not reach CocoaPods.
A clean firebase analytics setup for mobile apps comes down to a few habits: separate projects for testing and production, a short and deliberate event list, no personal data, validation in DebugView before every release, and Swift Package Manager on iOS. Get those right and your GA4 data will be something you can trust.
If your events still do not match across Firebase, GA4 and your attribution tool, email the details to contact@alfahadhridoy.com and I will review them in writing.