# funnel-and-retention

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

- **Space:** product-analytics-public (https://github.com/Tech-Realm/space-product-analytics-public/tree/main/funnel-and-retention)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, docker
- **Routes:** stdlib-reference, posthog; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use product-analytics-public/funnel-and-retention` or MCP `get_pack product-analytics-public/funnel-and-retention`
- **Files:** CHANGELOG.md, code/refflow.py, code/schema.json, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/scenario.json, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/product-analytics-public/funnel-and-retention

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
