Skip to content
All posts
June 1, 20264 min read

Analytics for Android Apps: What to Track and How to Use the Data

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.

AndroidFirebaseStartupSolo Dev
Share:

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.


Define Questions Before Events

Start with the questions you need answered, not the events you could track.

Good questions:

  • What percentage of users complete the onboarding flow?
  • Where do users drop off in the checkout process?
  • Which features do premium users use most?
  • How often do users use the search feature?

Bad questions that lead to tracking noise:

  • "How many events did we fire?"
  • "What's our event count by day?"

For each question, you need specific events with specific properties.


The Core Analytics Setup

kotlin
// build.gradle.kts
implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
implementation("com.google.firebase:firebase-analytics")

Basic event logging:

kotlin
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)
    }
}

What to Track: The Essential Events

Acquisition and Activation

kotlin
// 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.

Feature Usage

kotlin
// 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)
)

Monetization

kotlin
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.


User Properties

Firebase Analytics lets you set user-level properties that apply to all subsequent events:

kotlin
// 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?"


Screen Tracking

Firebase auto-tracks screens if you use standard Activity/Fragment patterns. For Compose, log manually:

kotlin
@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)
    }
}

Building Funnels in Firebase

After logging events, build funnels in Firebase Console:

  1. Analytics → Funnels → Create funnel
  2. Add steps:
    code
    onboarding_step_complete (step=1)
    code
    (step=2)
    code
    (step=3)
    code
    onboarding_complete

You'll see exactly what percentage of users reach each step. A 70% drop at step 2 is a clear signal.


What NOT to Track

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.


The Weekly Analytics Review

15 minutes once a week:

  1. Check active users trend — growing, flat, or declining?
  2. Check onboarding funnel — where are we losing users?
  3. Check retention (Firebase → Retention) — are users coming back on day 7/30?
  4. Check top 3 events — what are users actually doing?
  5. Check paywall funnel — what's this week's conversion rate?

One question answered, one hypothesis formed, one decision made. That's analytics working.


Takeaways

  • Define questions first, then build events to answer them
  • Track the core funnel: acquisition → activation → retention → revenue
  • User properties enable segmented analysis (free vs premium behavior)
  • Firebase funnels show exact drop-off points in multi-step flows
  • Never track PII — user emails, names, or phone numbers
  • Weekly 15-minute review turns data into decisions instead of noise
Share:
S

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.

Stay updated

Get new posts on Android, Kotlin, and solo dev straight to your inbox.

Newsletter preferences

Related Apps

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.

Building something? Available for Android dev and QA consulting.

Work with me

Comments — powered by Giscus

Apps tagged with this