Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 31 ยท Data Modeling and Patterns

Analytics, Crashlytics and Performance Monitoring

Log Firebase Analytics events, set user properties, mark conversions, build funnels and audiences, and learn Crashlytics, Performance Monitoring and Remote Config.

Shipping an app is the start of the work. You then need to know what people do in it, where they give up, which versions crash and which screens are slow. Firebase bundles a set of free or low-cost tools for this: Google Analytics for Firebase, Crashlytics, Performance Monitoring, Remote Config, A/B Testing, Cloud Messaging and App Distribution. Supabase has no built-in product analytics; you pair it with a tool such as PostHog or write events to your own tables (see Search, Aggregations and Analytics).

This lesson explains events, parameters, user properties, conversions, funnels and audiences, then the monitoring products. The SDK code is read-only because it needs a Firebase project and, for mobile, an app build. The runnable examples are plain-JavaScript stand-ins that compute funnels, conversion rates and audiences from an event list.

What Analytics collects

Analytics is event based. Each interaction is an event with a name and up to 25 parameters. Two kinds are collected for you:

  • Automatic events, such as first_open, session_start, screen_view, app_update and user_engagement.
  • Recommended and custom events, which you log yourself. Prefer the recommended names (sign_up, login, purchase, add_to_cart, select_content, share) because the reports understand them. Make custom names descriptive and snake_case, for example feature_engagement.

Add the SDK, then log events:

JavaScript
import { initializeApp } from "firebase/app";
import { getAnalytics, logEvent, setUserProperties, setUserId } from "firebase/analytics";

const app = initializeApp({ /* your config, including measurementId */ });
const analytics = getAnalytics(app);

// A recommended event
logEvent(analytics, "sign_up", { method: "email" });

// An in-app purchase with a value so revenue reports work
logEvent(analytics, "purchase", {
  transaction_id: "T-1001",
  currency: "USD",
  value: 9.99,
  items: [{ item_id: "pro-monthly", item_name: "Pro plan", price: 9.99 }]
});

// A custom event
logEvent(analytics, "feature_engagement", { feature: "dark_mode", action: "enabled" });

On Android (Kotlin) the equivalent is firebaseAnalytics.logEvent(FirebaseAnalytics.Event.PURCHASE, bundle) after adding google-services.json and the Gradle plugin; on iOS it is Analytics.logEvent(AnalyticsEventPurchase, parameters: [...]) with GoogleService-Info.plist added to the Xcode project.

A few rules: event and parameter names are case sensitive, you can define up to 500 distinct event names per app, and a parameter only appears in reports after you register it as a custom dimension or metric in the console. Never log personal data such as emails, names or phone numbers; it violates the terms and your users' trust.

A user property is a fixed attribute of the person rather than of one action, such as plan: "premium" or favorite_genre: "jazz". It is attached to every later event, so you can filter reports with it.

JavaScript
setUserProperties(analytics, { plan: "premium", favorite_genre: "jazz" });
setUserId(analytics, "u_1a2b3c");   // your own opaque id, never an email

In regions with consent laws, use Consent Mode to set analytics_storage and ad_storage to denied until the user agrees, and let people opt out with setAnalyticsCollectionEnabled(analytics, false).

Conversions, funnels and engagement

A conversion is an event you decide is valuable: sign_up, purchase, subscribe, generate_lead. In the console (Analytics, Events) you toggle Mark as key event (formerly "conversion") and every report then shows its count and value. Conversions let you:

  • Measure return on investment when you also link ad campaigns.
  • See which channel or campaign brings sign-ups, not just visits.
  • Make decisions with data instead of guesses.

A funnel is an ordered list of steps ("view product", "add to cart", "begin checkout", "purchase"). The funnel report shows how many users reach each step and the drop-off between steps, which tells you where to fix the design. Engagement metrics such as engaged sessions, average engagement time and retention (day 1, day 7, day 30) show whether people come back. Debug your event logging in real time with DebugView, and check Realtime reports for events within seconds.

Audiences and predictions

An audience is a group of users defined by rules, for example "users with plan = premium who triggered purchase in the last 30 days" or "Android users in Germany". Define audiences in the console (Analytics, Audiences, New audience) by combining demographics, device, user properties and events. Audiences power:

  • Targeted push messages through Cloud Messaging.
  • Remote Config and A/B Testing conditions ("show the new layout to this audience").
  • Remarketing in Google Ads.

Predictions use machine learning on your event history to forecast churn (will not be seen for 7 days) or purchase probability. You can build an audience like "likely to churn" and send a retention offer. Predictions need enough users and events to train, and respect data-privacy settings.

Try it: funnel, conversion and audience from events

Analytics does these calculations on Google's servers. The stand-in below does the same arithmetic on a small event list so you can see what a funnel report is really computing.

Node.js Compute a funnel, conversion rate and audience

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

The audience (u4) is exactly who you would target with a reminder message. In Firebase you would build the same group with a few clicks instead of code.

Crashlytics

Crashlytics collects crash reports in real time. It groups crashes by root cause into issues, shows the stack trace, device, OS version and the breadcrumb logs leading up to the crash, and tells you how many users each issue affects. Add the SDK and plugin, upload symbol files (dSYMs on iOS, mapping files on Android) so traces are readable, and add context:

Kotlin
FirebaseCrashlytics.getInstance().apply {
    setUserId("u_1a2b3c")
    setCustomKey("screen", "checkout")
    log("User tapped Pay")
    recordException(IllegalStateException("Card form was empty"))   // non-fatal error
}

Use velocity alerts to be told when a new issue spikes, and watch the crash-free users rate per version before widening a release.

Performance Monitoring

Performance Monitoring measures how fast your app feels. Without extra code it records app start time, screen rendering (slow and frozen frames) and HTTP request latency, size and success rate. You add custom traces for work you care about:

JavaScript
import { getPerformance, trace } from "firebase/performance";

const perf = getPerformance(app);
const t = trace(perf, "load_dashboard");
t.start();
t.putAttribute("plan", "premium");
await loadDashboard();
t.incrementMetric("rows_loaded", 120);
t.stop();

Data can be sliced by country, device, OS and app version, and compared before and after a release. Aim for the 90th percentile, not the average, because slow tails are what users complain about.

Other release tools

  • Remote Config changes app behavior or appearance with server-side parameters and conditions, without a new release. Pair it with A/B Testing to compare variants against a goal such as purchase.
  • Cloud Messaging (FCM) sends push notifications and data messages to devices, topics or audiences.
  • App Distribution ships pre-release builds to testers and collects their feedback before the store release.
  • Test Lab runs your app on real and virtual devices; Dynamic Links was retired in August 2025, so use your own deep-linking setup for new work.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is a user property in Firebase Analytics?

    User properties describe the person, so you can segment reports and audiences by them.
  2. 2. What does a funnel report show?

    Funnels count users through ordered steps and show the drop-off between steps.
  3. 3. Which data should you NOT send as event parameters?

    Personally identifiable information must not be sent to Analytics. Use opaque ids instead.
  4. 4. What makes Crashlytics stack traces readable on release builds?

    Obfuscated or stripped builds need dSYM or mapping files so frames show real names.
  5. 5. Which tool lets you change app behavior without publishing a new version?

    Remote Config delivers parameters and conditions from the server at runtime.

Summary

  • Analytics is event based: automatic events, recommended events and custom events with parameters; add user properties for segmentation and respect consent.
  • Mark valuable events as key events (conversions), read funnels for drop-off and build audiences from rules or predictions.
  • Crashlytics groups crashes by cause with breadcrumbs; Performance Monitoring tracks start time, rendering, network and custom traces.
  • Remote Config, A/B Testing, Cloud Messaging and App Distribution handle releases and communication.
  • Supabase has no built-in analytics; use a third-party tool or your own event tables.

Next: Project: Realtime Todo App.