DEV Community

Alex Koval
Alex Koval

Posted on

How to detect where users drop off with 5 lines of code (no Mixpanel, no Amplitude)

Most analytics tools are overkill for early-stage products. You don't need 50 dashboards. You need to know one thing: where are users dropping off?

I've been building an analytics tool and along the way figured out patterns that work for detecting user drop-offs early. Here's the practical breakdown.


The problem with traditional analytics setup

You install Mixpanel or Amplitude. You track 200 events. You build funnels. You stare at charts. Two weeks later you still don't know why users leave after the onboarding screen.

The issue isn't tracking. It's interpretation.


What actually matters: the critical path

Before you track anything, map your critical path. That's the 3-5 actions a user MUST complete to get value from your product.

For example:
Sign up -> Connect data source -> See first insight -> Invite teammate

That's it. Everything else is noise at this stage.


Lightweight tracking that tells you what's broken

Here's a minimal approach. Track only your critical path steps with timestamps:

// Track critical path steps with timing
const trackStep = (step, metadata = {}) => {
  const payload = {
    step,
    timestamp: Date.now(),
    sessionId: getSessionId(),
    timeSinceLastStep: getTimeSinceLastStep(),
    ...metadata
  };

  navigator.sendBeacon('/api/track', JSON.stringify(payload));
};

// Usage
trackStep('signup_complete');
trackStep('data_source_connected', { source: 'postgres' });
trackStep('first_insight_seen', { insightType: 'drop_off' });
trackStep('teammate_invited');
Enter fullscreen mode Exit fullscreen mode

The metric nobody tracks: time between steps

Drop-off rate between steps is obvious. Everyone tracks that. But time between steps is where the real signal is.

If 80% of users complete Step 1 → Step 2, but it takes them 15 minutes on average when it should take 2, you have a UX problem that won't show up in a conversion funnel.

// Simple analysis: find where users get stuck
const analyzeDropoffs = (events) => {
  const steps = ['signup', 'connect_source', 'first_insight', 'invite'];

  const analysis = steps.map((step, i) => {
    if (i === 0) return null;

    const prevStepUsers = events.filter(e => e.step === steps[i-1]);
    const thisStepUsers = events.filter(e => e.step === step);

    const conversionRate = thisStepUsers.length / prevStepUsers.length;

    // Calculate median time between steps
    const times = thisStepUsers.map(curr => {
      const prev = prevStepUsers.find(p => p.sessionId === curr.sessionId);
      return prev ? curr.timestamp - prev.timestamp : null;
    }).filter(Boolean);

    const medianTime = times.sort((a,b) => a-b)[Math.floor(times.length/2)];

    return {
      transition: `${steps[i-1]} -> ${step}`,
      conversionRate: (conversionRate * 100).toFixed(1) + '%',
      medianTimeSeconds: (medianTime / 1000).toFixed(0),
    };
  }).filter(Boolean);

  return analysis;
};
Enter fullscreen mode Exit fullscreen mode

Output looks like this:
signup -> connect_source: 62.3% | median: 340s ⚠️
connect_source -> first_insight: 89.1% | median: 12s ✓
first_insight -> invite: 23.7% | median: 890s ⚠️

Now you know exactly where to focus. No dashboards needed.


Three patterns that predict churn

From working with beta users, these are the signals that consistently predict whether someone will stick around:

1. Time-to-first-value over 5 minutes = danger zone.
If a user can't get value from your product in the first 5 minutes, the chance they come back drops off a cliff. Measure this obsessively.

2. "Browse but never create" pattern.
Users who view 10+ pages but never perform a creation action (write, build, upload, connect) are tourists. They won't convert.

3. Solo usage after day 3.
For any collaborative product, if a user hasn't involved someone else by day 3, retention drops dramatically. The product becomes a solo experiment that gets forgotten.


When this DIY approach breaks down

This works great for your first 100-1000 users. After that you start needing:

  • Automatic segmentation — paid vs churned behavior comparison
  • AI pattern detection — finding signals you didn't think to look for
  • Real-time recommendations — "this user is about to churn, here's why"

This is exactly what I'm building with Xora Analytics. Instead of more dashboards, the AI analyzes user behavior and tells you what's broken and what to fix. 5 lines of SDK integration.

But honestly, start with the simple approach above. You'd be surprised how much you learn from just tracking 4-5 critical steps.


What's your critical path? And where do users get stuck? Would love to hear what patterns others have found.

Top comments (0)