MyFamilyTracker
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
Most developers track too many events and learn nothing from them. Here's how to define a lean analytics strategy, implement it with Firebase Analytics, and actually make decisions based on the data.
On this page
Most apps track dozens of events and look at them once. "Sessions last month: 12,000." What does that mean? What do you do with it?
Analytics is only valuable if it drives decisions. Here's how to build an analytics strategy that actually tells you something actionable.
Start with the questions you need answered, not the events you could track.
Good questions:
Bad questions that lead to tracking noise:
For each question, you need specific events with specific properties.
// build.gradle.kts
implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
implementation("com.google.firebase:firebase-analytics")Basic event logging:
class Analytics @Inject constructor(
private val firebaseAnalytics: FirebaseAnalytics
) {
fun trackEvent(name: String, params: Map<String, Any?> = emptyMap()) {
val bundle = Bundle().apply {
params.forEach { (key, value) ->
when (value) {
is String -> putString(key, value)
is Int -> putInt(key, value)
is Long -> putLong(key, value)
is Double -> putDouble(key, value)
is Boolean -> putBoolean(key, value)
}
}
}
firebaseAnalytics.logEvent(name, bundle)
}
}// First app open
fun trackFirstOpen() = trackEvent("first_open")
// Onboarding step completion
fun trackOnboardingStep(step: Int, stepName: String) = trackEvent(
"onboarding_step_complete",
mapOf("step" to step, "step_name" to stepName)
)
// Onboarding completion
fun trackOnboardingComplete(timeToComplete: Long) = trackEvent(
"onboarding_complete",
mapOf("duration_seconds" to timeToComplete / 1000)
)Onboarding is your highest-leverage conversion funnel. If users drop off at step 2, you know exactly where to focus.
// Core feature actions — the verbs of your app
fun trackTaskCreated(hasDescription: Boolean, hasDueDate: Boolean) = trackEvent(
"task_created",
mapOf(
"has_description" to hasDescription,
"has_due_date" to hasDueDate
)
)
fun trackTaskCompleted(taskAge: Long) = trackEvent(
"task_completed",
mapOf("task_age_hours" to taskAge / 3600_000)
)
fun trackSearchUsed(resultCount: Int) = trackEvent(
"search_used",
mapOf("result_count" to resultCount)
)fun trackPaywallShown(trigger: String) = trackEvent(
"paywall_shown",
mapOf("trigger" to trigger)
)
fun trackPurchaseStarted(productId: String, price: String) = trackEvent(
"purchase_started",
mapOf("product_id" to productId, "price" to price)
)
fun trackPurchaseCompleted(productId: String) = trackEvent(
"purchase_complete",
mapOf("product_id" to productId)
)The paywall funnel: shown → started → completed. The conversion rate at each step is actionable data.
Firebase Analytics lets you set user-level properties that apply to all subsequent events:
// Set once (typically after login or onboarding)
firebaseAnalytics.setUserProperty("subscription_tier", "free")
firebaseAnalytics.setUserProperty("task_count_bucket", when {
taskCount < 10 -> "low"
taskCount < 50 -> "medium"
else -> "high"
})User properties enable segmented analysis: "what features do premium users use vs free users?"
Firebase auto-tracks screens if you use standard Activity/Fragment patterns. For Compose, log manually:
@Composable
fun TaskListScreen(analytics: Analytics) {
DisposableEffect(Unit) {
analytics.trackScreen("task_list")
onDispose { }
}
// ...
}
// In Analytics class
fun trackScreen(screenName: String) {
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW) {
param(FirebaseAnalytics.Param.SCREEN_NAME, screenName)
param(FirebaseAnalytics.Param.SCREEN_CLASS, screenName)
}
}After logging events, build funnels in Firebase Console:
onboarding_step_complete (step=1)(step=2)(step=3)onboarding_completeYou'll see exactly what percentage of users reach each step. A 70% drop at step 2 is a clear signal.
Personal information: No emails, names, or device identifiers. Firebase Analytics auto-collects a device ID — don't add more. GDPR/CCPA compliance depends on this.
Events that don't map to decisions: "user_opened_settings" tells you nothing actionable unless you have a hypothesis about settings usage. Add events when you have a reason.
Micro-interactions: "user_scrolled_0.5_inches," "user_tapped_empty_space." Signal-to-noise ratio collapses. You'll never look at these.
15 minutes once a week:
One question answered, one hypothesis formed, one decision made. That's analytics working.
Sudarshan Chaudhari
AI Systems Builder / Product Engineer
Bangkok, Thailand
Solo Android developer with 13+ years in QA, building Android apps, AI automation systems, and developer tools at SudarshanTechLabs.
Related Posts
Related Apps
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
Building something? Available for Android dev and QA consulting.
Work with meComments — powered by Giscus
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
ReadSend gentle nudges, emojis, and short voice notes to say "I miss you" without chatting.
Read