Skip to main content

Command Palette

Search for a command to run...

PostHog: All-in-One Production Monitoring That Actually Works

Published
12 min read
PostHog: All-in-One Production Monitoring That Actually Works

Most development teams use a scattered toolkit for production monitoring: one service for analytics, another for session replay, a third for error tracking, and yet another for feature flags. Each tool has its own dashboard, its own API, and its own way of identifying users.

The problem? When a user hits an error, you can't easily connect it to their session replay. When analytics show a conversion drop, you can't filter by which feature flags were enabled. Everything exists in silos.

PostHog solves this by putting everything in one platform with shared user data and connected insights.

What PostHog Actually Is

PostHog is an all-in-one developer platform that consolidates your monitoring stack:

  • Product analytics (like Mixpanel/Amplitude)

  • Session replay (like FullStory/Hotjar)

  • Error tracking (like Sentry)

  • Feature flags (like LaunchDarkly)

  • A/B testing (like Optimizely)

  • User surveys

  • And more

All in one place. Same dashboard. Same user data. Same event stream.

The game-changer? Everything is connected. You don't just see that an error happened – you can watch the session replay of exactly what the user did before the error. You don't just see analytics – you can filter for users with specific feature flags enabled and watch their sessions.

Session Replay: See Exactly What Users Do

When users report issues like "your checkout is broken," reproducing the problem can be nearly impossible without seeing what actually happened. Session replay solves this by recording every interaction.

PostHog records every click, scroll, mouse movement, and interaction. Here's what makes it different:

It's Not Just a Video

PostHog doesn't record video – it records the DOM. This means:

  • Tiny file sizes (a 10-minute session might be 50KB instead of 50MB)

  • Searchable (you can search for text that appeared on screen)

  • Privacy-friendly (automatic masking of sensitive inputs)

  • Lower bandwidth (doesn't slow down your users' experience)

Console Logs Are Included

When watching a session replay, you can see the actual console output from that user's browser. This eliminates the need to ask users to check their console and send screenshots.

Real example: A user reported that a payment form "stops working." The session replay showed a JavaScript error firing when they entered a Canadian postal code. The validation regex was breaking on Canadian formats. The issue was identified and fixed in minutes by simply watching what happened.

Network Requests Are Captured Too

You can see every API call made during the session:

  • Request/response status codes

  • Headers (automatically scrubbed of sensitive data)

  • Timing information

  • Failed requests

This is invaluable when debugging "it's slow" complaints. You can see exactly which API call took 4 seconds and made the UI feel sluggish.

Filtering by Behavior

Here's where it gets smart. You can filter replays by:

  • Rage clicks (user clicked the same thing 5+ times – usually means something's broken)

  • Console errors (sessions where JavaScript errors occurred)

  • Dead clicks (clicked things that do nothing)

  • Specific events (show me everyone who started checkout but didn't complete it)

  • User properties (show me sessions from enterprise customers only)

You can create saved filters for common debugging scenarios. For example, filtering for "rage clicks + console errors" provides a weekly report of things that are likely broken. Users don't always report bugs, but they do rage-click when things don't work.

Error Tracking: Sentry, But Connected

PostHog's error tracking is relatively new, but it's already better than using Sentry for one simple reason: you can watch the session replay.

How It Works

Install the SDK (one line of code), and PostHog automatically captures:

  • JavaScript exceptions

  • Unhandled promise rejections

  • Console errors

  • Custom errors you log

But unlike traditional error monitoring, every error is linked to:

  • The session replay showing what the user did

  • The user's properties (browser, OS, location, custom properties)

  • The sequence of events leading up to the error

  • Network requests that might have failed

The Error Dashboard

Errors are grouped by stack trace, so you don't get 1,000 reports of the same error. You get one error with "1,000 occurrences."

For each error group, you can see:

  • How many times it occurred

  • How many users were affected

  • When it first appeared (useful for knowing which deploy broke it)

  • Which browser/OS combinations trigger it

  • A link to watch any of the session replays where it happened

That last one is the key. Click "Watch session" and you're immediately watching the exact moment the user hit the error. No guessing. No trying to reproduce it. Just watch what happened.

Stack Traces That Make Sense

PostHog supports source maps, so your minified production errors show the actual source code. No more trying to figure out what a.b.c is undefined means when it's actually user.profile.avatar.

Upload your source maps once (automatic with most build tools), and every stack trace shows readable code.

Product Analytics: Understand Your Users

The analytics part is where PostHog really shines, because it's not just numbers – it's numbers with context.

Events and Properties

Everything in PostHog is built around events. Every interaction can be tracked:

posthog.capture('user_signed_up', {
  plan: 'pro',
  trial: true,
  source: 'landing_page'
});

Then you can:

  • Count how many signups you got

  • Filter by plan type

  • See which sources convert best

  • Watch session replays of users who signed up

That last part keeps coming up because it's so damn useful. Analytics tell you what is happening. Session replay tells you why.

Funnels

Create a signup funnel:

  1. Visited landing page

  2. Clicked "Sign Up"

  3. Completed form

  4. Verified email

  5. Completed onboarding

PostHog shows you:

  • Conversion rate at each step

  • Where people drop off

  • Click any drop-off point to watch replays of users who abandoned the flow

Example: A 40% drop-off at an email verification step led to watching session replays, which revealed that the verification redirect was broken on mobile Safari. After fixing the CSS issue, conversion improved significantly.

User Paths

This visualization shows the actual paths users take through your app. Not what you think they do – what they actually do.

You can see patterns like:

  • 60% of users who visit pricing go to the docs before signing up (they want to see if it's technical enough)

  • Users who watch the demo video convert 3x better

  • People keep clicking the logo expecting it to go home, but it doesn't (oops)

And yes, you can click any node in the path and watch replays of users who took that path.

Feature Flags: Ship Fearlessly

Feature flags let you deploy code without showing it to everyone. This is table stakes nowadays, but PostHog's integration makes it powerful.

The Basic Use Case

if (posthog.isFeatureEnabled('new-checkout')) {
  // Show new checkout flow
} else {
  // Show old checkout
}

Deploy the code to everyone, but only turn on the flag for:

  • Internal users (test it first)

  • 5% of users (gradual rollout)

  • Enterprise customers (they get features early)

  • Users in specific regions

  • Whatever conditions you want

Why It's Better in PostHog

Because it's connected to everything else:

Analytics: Create a funnel comparing new-checkout vs old-checkout. Which one converts better? You have data.

Session replay: Filter replays by "has flag new-checkout enabled." Watch how people actually use the new feature.

Errors: Filter errors by feature flag. Is the new checkout causing errors? You'll know immediately.

Surveys: Show a survey only to users with a specific flag enabled. "How was the new checkout experience?"

All of this happens automatically. You're not manually trying to connect Amplitude analytics to LaunchDarkly flags to Hotjar recordings. It's one system.

Quick and Simple Setup

Setting up PostHog is straightforward. Add this script to your HTML:

<script>
  !function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
  posthog.init('YOUR_PROJECT_API_KEY', {api_host: 'https://us.posthog.com'})
</script>

That's it. You now have:

  • Analytics

  • Session replay

  • Error tracking

  • Feature flags

  • Everything

Want to track custom events? One line:

posthog.capture('button_clicked', { button_name: 'pricing_cta' });

Want to identify a user?

posthog.identify('user_123', {
  email: '[email protected]',
  plan: 'pro'
});

For backend events (Node, Python, Go, whatever), there's an SDK:

// Node.js
const posthog = require('posthog-node');
const client = new PostHog('YOUR_PROJECT_API_KEY');

client.capture({
  distinctId: 'user_123',
  event: 'server_side_event',
  properties: { source: 'api' }
});

Real-World Debugging Examples

1. Intermittent Bugs

Problem: Users reported a bug that only happened "sometimes" and couldn't be reproduced in development.

Solution: Filtered PostHog for sessions with console errors in the past week. Found 47 sessions with the same error. After watching three replays, the pattern emerged: the bug only occurred when users navigated directly to a page rather than through the normal app flow. The state wasn't being initialized correctly on direct page loads.

Result: Issue identified and fixed in one day instead of weeks of back-and-forth debugging.

2. Sudden Conversion Drop

Problem: Signup conversion dropped 15% overnight. Analytics showed the drop but not the cause.

Solution: Watched 20 session replays of users who started signup but didn't finish. The issue was found in the first 5 replays: the email verification link was returning a 404 error.

Result: A routing refactor had broken the verification endpoint. Quick fix once the problem was identified.

3. Low Feature Adoption

Problem: A new dashboard feature that took two weeks to build had almost no usage according to analytics.

Solution: Watched replays of users who should have been using the feature based on their behavior patterns. The issue: users literally couldn't find it. The button was buried in the settings menu that nobody opened.

Result: Moved the button to the main navigation, and usage increased 10x.

4. Platform-Specific Bug

Problem: "Your app is broken on my phone" – but it worked fine in testing on iPhone and mobile emulators.

Solution: Found the user's session in PostHog. They were on an older iOS version that hadn't been tested. The replay showed the exact UI element that wasn't rendering.

Result: Identified a Safari 14 on iOS 14.3 specific CSS issue, fixed it, and confirmed the fix with another session replay from that user.

What It Costs (And Why It's Worth It)

PostHog has a generous free tier:

  • 1 million events per month

  • 5,000 session recordings per month

  • Unlimited feature flags

  • Unlimited team members

For most small apps, this is enough.

When you outgrow it, you pay for what you use:

  • Events: starts around $0.00005 per event

  • Recordings: around $0.005 per recording

  • Feature flag requests: almost free

There's also a self-hosted option if you want to run PostHog on your own infrastructure. It's fully open source.

Cost comparison: For a production app with ~300K monthly active users, PostHog costs around \(50/month. Using separate tools (Mixpanel + FullStory + Sentry + LaunchDarkly) typically costs \)400+/month.

The "But What About..." Questions

"Isn't this just Google Analytics with extra steps?"

No. Google Analytics tells you pageviews and bounce rates. PostHog tells you that user #42 rage-clicked the submit button 7 times, saw an error, and left. Then lets you watch exactly what happened.

"What about GDPR / privacy?"

PostHog is built with privacy in mind:

  • Automatic masking of password/credit card inputs

  • Can self-host in your own region

  • Respects Do Not Track

  • Full data control and deletion

  • GDPR compliant

"Does it slow down my site?"

The script is ~40KB gzipped. Session replay data is sent asynchronously. In practice, the performance impact is negligible.

We've tested it extensively – no measurable impact on page load times or Core Web Vitals.

"Why not just use the browser DevTools?"

Because DevTools only work when you're the one using the app. PostHog works for all your users, in production, all the time.

Key Considerations

PostHog consolidates multiple monitoring tools into one platform with connected data. This solves the common problem of needing to manually correlate information across separate analytics, session replay, error tracking, and feature flag services.

Strengths:

  • Everything is connected (errors link to session replays, analytics filter by feature flags)

  • Single source of truth for user data

  • Significant cost savings compared to multiple tools

  • Privacy-focused with GDPR compliance

Limitations:

  • UI can be overwhelming initially due to the breadth of features

  • Documentation is comprehensive but dense

  • Costs can scale up significantly for very large apps (10M+ events/day)

Best fit for:

  • Teams currently using 3+ separate monitoring tools

  • Apps with 100K - 5M monthly active users

  • Development teams that want integrated debugging workflows

Getting Started

The recommended approach:

  1. Sign up for the free tier at posthog.com

  2. Add the snippet to your site (2-minute setup)

  3. Create a simple funnel for your main conversion flow

  4. Enable session recordings

  5. Review sessions the next day to identify improvement opportunities

Within 24 hours, most teams identify at least one actionable insight from the combination of analytics and session replays.


Have experience using PostHog for production monitoring? Share your insights in the comments.