Skip to content

Packs / product-analytics-public

funnel-and-retention

Compute a signup-to-pay funnel and day-N retention from raw events

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-product-analytics-public

Install

logicpacks pack use product-analytics-public/funnel-and-retention
get_pack product-analytics-public/funnel-and-retention

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: stdlib-referenceposthog
  • Checks: 2 in outcome/checks.yaml
  • Code: refflow.pyschema.json
  • Tools: python3, docker

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Compute a signup-to-pay funnel and day-N retention from raw events. Our reference flow (code/refflow.py, stdlib sqlite) proves the records, allowed moves, numbers and export; the same rules carry over to the self-hosted app.

Steps

  1. Events: user_id, event, time (export from PostHog/Umami).
  2. Funnel counts users who did each step in order (visit -> signup -> activate -> pay).
  3. Day-N retention = users active N days after their first day / all users.
  4. Cross-check with the analytics space (GA4) numbers for the same days.

Edge cases

  • Users who skip a step don't count for later steps.
  • Time zones change day boundaries; use the business zone consistently.

Don'ts

  • Don't mix test accounts into the numbers.

Check

lp pack check product-analytics/funnel-and-retention runs outcome/checks.yaml.