Track a few events that describe whether your app delivers its value, name them noun_verbed in snake_case, never put names, emails or free text in them, and keep collection switched off until the user agrees where the law requires it. Three to eight events answer most questions.

This guide is for founders and Flutter developers who want to know what users do without collecting more than they need. It covers PostHog (posthog_flutter 5.56.0, published by posthog.com) and Firebase Analytics (firebase_analytics 13.0.0, published by firebase.google.com), as of October 2026. The running example is a bakery app with an "order placed" goal.

In short:

  • Pick events from the user's path: arrive, start, finish, fail.
  • Event properties must never hold emails, names, phone numbers or notes.
  • On Flutter web, PostHog needs a script in web/index.html, not only Dart.
  • You can turn Firebase collection off and on at runtime.

Track the path to one goal

For the bakery, the goal is a placed order. Five events cover it: menu_viewed, item_added, checkout_started, order_placed and checkout_failed. Comparing the counts shows where people drop off. A hundred automatic click events answer nothing.

Name events as a noun and a past-tense verb, and never rename one. Renaming splits your history in two.

Keep personal data out of events

Properties like {'items': 3, 'total': 24.5} are fine. Do not send an email, full name, phone number, card detail, health detail or a free-text note.

Users did not agree to put that in an analytics tool, and it is the copy nobody remembers to delete. If you must link events to a person, send your own opaque user id, not their email.

PostHog in a few lines

PostHog is a product analytics tool you can use in the cloud or self-host. The Flutter docs show setup and capture:

final config = PostHogConfig('<project_token>')
                ..host = 'https://eu.i.posthog.com'; // must match your project's region
              await Posthog().setup(config);
              
              await Posthog().capture(
                eventName: 'order_placed',
                properties: {'items': 3},
              );
              

Two traps. First, the host must match your project region or events are lost. Second, the docs state that Posthog().setup() is a no-op on web, so a web build captures nothing unless you also paste PostHog's web snippet into web/index.html. Check this before you trust a zero.

Firebase Analytics is simpler but tied to Google

firebase_analytics needs only flutter pub add firebase_analytics and a configured Firebase project. Then FirebaseAnalytics.instance.logEvent(name: 'order_placed', parameters: {'items': 3}). It supports Android, iOS, macOS and web. Reports live in Google Analytics, which is good for acquisition and ads and weaker for step-by-step product questions.

Ask first, then collect

Where consent is required, such as in the EU for non-essential tracking, collect nothing before the user agrees. Firebase provides setAnalyticsCollectionEnabled(false) to disable collection. On Android and iOS, the setting persists across launches; on web, reapply the consent state on each page load before allowing collection. For consent-gated native apps, disable collection before startup: set firebase_analytics_collection_enabled to false in Android's AndroidManifest.xml and FIREBASE_ANALYTICS_COLLECTION_ENABLED to false in Apple's Info.plist. Enable it only after consent. On web, defer Analytics initialization until consent.

This is general information, not legal advice. For the rules that apply to you, read the regulator's guidance, for example GDPR Article 7 on conditions for consent, and ask a lawyer about your case.

Count each event once

If the app and a server both report the same purchase, your numbers double and nothing errors. Pick one place per event.

Generated apps never use Firebase Analytics

The GrowApps builder sends analytics from generated apps to your own account: PostHog by default, or your own Google Analytics stream or Meta pixel. It never adds firebase_analytics.

The reason: generated apps share GrowApps' Firebase project, so Firebase Analytics events would land in GrowApps' property, not yours. Consent stays your responsibility as the app owner. More at growapps.ai.

Pick one goal and four events

Write down your app's one goal and the 3 to 5 events on the path to it. Add only those. After a week, divide each count by the one before it to find your biggest drop. Then read about planning an MVP.

Sources and further reading