Harmonising Analytics: PostHog + Firebase
Every tap, swipe, and screen transition in your mobile app tells a story. But here's the challenge: if you're not listening to these stories, you're building in the dark. Event tracking isn't just about collecting data, it's about understanding user behaviour, catching errors before they cascade, and making informed decisions about features that actually matter.
At Hoomanely, we're building a preventive healthcare platform that empowers pet parents to keep their furry companions healthy and happy. From AI-powered health consultations to community-driven care advice, understanding how users interact with these features is essential. This post explores how we built a robust analytics foundation combining the behavioural intelligence of PostHog with the crash reporting power of Firebase.
Why generic event tracking matters
Generic events, screen views, button clicks, form submissions, form the backbone of user behaviour analysis, answering fundamental questions like where users spend time and where they drop off. Events aren't just for analytics teams, when a user encounters an error during pet profile creation, these events become critical diagnostic tools. Rolled out a new community feature? Event tracking tells you if users are actually adopting it. Beyond crashes, event tracking reveals performance bottlenecks, are users abandoning a screen because it's slow, events provide the breadcrumbs to trace these issues.
The two pillars: PostHog and Firebase
Rather than choosing between analytics platforms, we embraced both, each excelling in its domain. PostHog handles everything related to understanding what users do, event capture with rich context, session recordings, and funnels and retention analysis. PostHog shines when you need to answer questions like how many users completed onboarding in their first session.
Firebase Crashlytics and Analytics handle the what-went-wrong side, automatic capture of fatal errors with full stack traces, non-fatal error tracking, and real-time error alerts. Firebase excels at reliability, when your app crashes on a specific Android device model, Firebase tells you exactly which code path failed and how many users are affected.

The implementation strategy
The key to smooth analytics integration is non-blocking initialisation, nothing should delay your app's startup. We initialise Firebase before the UI renders, ensuring crash reporting is active from the moment your app starts. PostHog initialisation happens in a post-frame callback, after your first screen paints, preventing analytics setup from blocking your initial render.
Every event needs context, raw events like "screen_viewed" aren't useful without knowing who viewed it and what their state was. Our analytics helper automatically enriches events with user identifiers, hashed IDs and email, pet context, which profile is active, session metadata, and device info. This enrichment happens transparently, we call a simple tracking function and the helper injects all necessary context.
Solving real problems
Analytics shouldn't crash your app, every tracking call is wrapped in error handling, if PostHog throws an exception we log it to Firebase and continue, if Firebase is unavailable we skip crash reporting but don't block user functionality. Privacy matters too, before any event leaves the device we sanitise properties, stripping empty values, converting types safely, and filtering sensitive data, hashing email addresses before transmission and truncating raw user inputs.
Lessons from production
Getting crash reporting active before anything else catches critical startup failures, but for behavioural analytics, waiting until after first frame prevents performance issues. Redundancy reduces panic, when PostHog had an outage, Firebase kept recording errors, when Firebase hit rate limits, PostHog captured behaviour, having two systems means you always have some visibility. Context is everything, raw events are useless without it, auto-enrichment transforms "button_clicked" into actionable insight.
Key takeaways
- Embrace specialisation, PostHog for behaviour, Firebase for crashes, don't force a single platform to do everything.
- Design for failure, event triggers, error handling, and redundant tracking ensure you don't lose critical data when services falter.
- Performance is non-negotiable, non-blocking initialisation and async operations keep your app responsive, analytics should be invisible to users.
- And context drives insight, auto-enriched properties transform raw events into actionable intelligence.