Most small apps log either nothing or everything. Both leave you unable to answer the only questions that matter early on: do people finish onboarding, do they reach the core action, and do they pay. Firebase Analytics in Flutter takes minutes to add. Choosing what to log takes more thought, so this post spends most of its time there.
It is one part of building a Flutter app with Claude Code.
Setup in two commands
With Firebase already configured (see Firebase for Flutter with Claude Code):
flutter pub add firebase_analytics
flutterfire configure
Then use FirebaseAnalytics.instance anywhere after Firebase.initializeApp. There is no separate start call.
What you get for free
Before you write a line of tracking code, Google Analytics already collects these app events automatically:
first_open: the first launch after install or reinstall.session_start: a user engages with the app.screen_view: a screen transition.user_engagement: the app is in the foreground for at least one second.app_update: the app was updated and launched again.os_update: the device OS was updated.in_app_purchase: an in-app purchase completed through the App Store or Google Play.app_remove: an uninstall, on Android only.
So installs, sessions, engagement time and store purchases are covered. Do not re-log them under your own names; you would only split the data.
Use recommended names where they fit
Google publishes a list of recommended event names. Using them, instead of inventing your own, means reports and integrations already understand them. The ones most apps need:
| Event | When to log it |
|---|---|
tutorial_begin |
User starts onboarding |
tutorial_complete |
User finishes onboarding |
sign_up |
User creates an account |
login |
User signs in |
select_content |
User picks a piece of content |
share |
User shares content |
search |
User searches |
purchase |
User completes a purchase |
Games have their own set, such as level_start, level_end and post_score.
The FlutterFire docs show both a typed helper and the generic call:
await FirebaseAnalytics.instance.logSelectContent(
contentType: 'image',
itemId: itemId,
);
await FirebaseAnalytics.instance.logEvent(
name: 'select_content',
parameters: {
'content_type': 'image',
'item_id': itemId,
},
);
The events that actually matter
For an early-stage app, a good event plan fits on one screen. Think in a funnel: did they arrive, did they set up, did they get value, did they come back, did they pay.
tutorial_beginandtutorial_complete. The gap between them is your onboarding drop-off. If it is large, nothing else matters yet. See mobile app onboarding best practices.sign_up, logged withlogSignUp(signUpMethod: ...)(apple, google, anonymous). Tells you which sign-in options people actually use.- One “core action” custom event. The thing your app exists for:
workout_completed,note_created,scan_finished. This is your activation metric. paywall_viewed(custom) with aplacementparameter, so you know whether the onboarding paywall or the settings upsell gets seen. Pair it with your subscription data. See mobile app paywall design.share, if sharing is part of your growth plan.- One error event for silent failures, such as
sync_failed, if you are not already sending these to Crashlytics.
That is six to eight events. Add more only when you have a question one of them cannot answer.
A custom event looks like this:
await FirebaseAnalytics.instance.logEvent(
name: 'workout_completed',
parameters: {
'duration_min': 32,
'type': 'strength',
},
);
Put tracking in one place
Do not scatter FirebaseAnalytics.instance.logEvent across widgets. Wrap it in a small class so names stay consistent and you can swap or mock it in tests:
class Analytics {
Analytics(this._fa);
final FirebaseAnalytics _fa;
Future<void> onboardingStarted() => _fa.logTutorialBegin();
Future<void> onboardingDone() => _fa.logTutorialComplete();
Future<void> coreAction(String type) => _fa.logEvent(
name: 'workout_completed',
parameters: {'type': type},
);
}
With Riverpod, expose it as a provider and override it in tests. See Riverpod with Claude Code and feature-first Flutter architecture for where this class should live.
Know the limits
From the Firebase events guide:
- “you can log up to 500 different Analytics Event types in your app.”
- “There is no limit on the total volume of events your app logs.”
- “event names are case-sensitive”, so
Shareandshareare two events. - “Parameter names can be up to 40 characters long and must start with an alphabetic character.”
- “String parameter values can be up to 100 characters long.”
- The
firebase_,google_andga_prefixes are reserved and should not be used for parameter names.
User properties are tighter: Firebase says “you can set up to 25 different user properties per project,” and each needs a custom definition in the console. Save them for stable traits like plan tier, not for things that change every session.
You can also set parameters on every event with setDefaultEventParameters (not supported on web). Valid values are “String and num”, and a value passed directly to logEvent() wins over the default.
Check events with DebugView
Normally “events logged by your app are batched together over the period of approximately one hour and uploaded together.” That is why new events seem missing. Debug mode uploads them “with a minimal delay” and shows them in DebugView in the Firebase console.
Android:
adb shell setprop debug.firebase.analytics.app com.example.myapp
Turn it off again with:
adb shell setprop debug.firebase.analytics.app .none.
iOS: add -FIRDebugEnabled to the Runner scheme’s launch arguments in Xcode. Use -FIRDebugDisabled to turn it off.
Walk through your funnel once on each platform and confirm every event appears with the right parameters. Add that pass to your mobile app QA checklist.
Privacy
Analytics is data collection. Declare it in Apple’s privacy details and Google’s Data safety form (see the app privacy labels guide). Never put emails, names or free text from users into event parameters.
Read it weekly
Logging is only useful if someone looks. Once a week, check onboarding completion, the share of new users who reach the core action, and paywall views to purchases. Put those three numbers in your weekly app monitoring routine.
MobileKit’s build skill wires an analytics wrapper like this one into new projects, so event names stay consistent from day one.
Sources read on the day this post was written: Firebase: Log events (Flutter), Firebase: DebugView, Firebase: User properties, FirebaseAnalytics API reference, Google Analytics: Automatically collected events and Google Analytics: Recommended events.