Production-only executive funnel, account and agency filters, and replay links
User Journey Stats is a compact, mobile-first view for answering three questions:
It intentionally omits technical charts, raw IDs, event-property exploration, and an environment selector. Those workflows belong in PostHog.
READ_ONLY_PROD_DB.environment query parameter is ignored.journey_event.environment = 'production'.Activity from dev.zooly.ai belongs in PostHog with environment = development; it will not appear in this dashboard. To validate Stats, run the
journey on app.zooly.ai after Production configuration is deployed.
An account is classified as an agency when it appears as agent_account_id in at least one active account_agents relationship. The legacy agentOrAgency field is not used.
Selecting an agency includes:
user_session_idGET /api/admin/z-agent/journey?days=7&scopeType=all|account|agency&scopeId=<id>&qa=exclude|include|only
The response is intentionally small:
{
generatedAt: string;
qa: "exclude" | "include" | "only";
summary: Record<string, number>;
funnel: Array<{
key: string;
label: string;
count: number;
percentOfStart: number;
}>;
recentJourneys: Array<RecentJourney>;
}
GET /api/admin/z-agent/journey/accounts?q=<name-or-slug>&qa=exclude|include|only
The response returns up to 50 non-deleted options matching the QA mode. It searches display name and slug and never exposes email addresses. A real agency with QA members remains selectable in QA-only mode. See Identity and zQA Filters for anonymous-session stitching, actor/target distinctions and differences from PostHog's broader internal-user filter.
Each row shows only:
The Replay button appears only when a PostHog session ID and replay-consent metadata are present. It opens:
${POSTHOG_PROJECT_URL}/replay/{sessionRecordingId}
Missing replay metadata hides the button instead of creating a broken search link.
Summary counts and recent rows use the same visit boundaries. An explicit
user_session_id is preferred; a posthog_session_id is the fallback. Events
without either are standalone observations, not a multi-day session grouped by
user or account ID. A gap of 30 minutes or more splits a persisted session
into a new visit. Activity after an explicit logout also starts a new visit.
These derived visit keys are for Stats, not PostHog replay IDs.
| Status | Meaning |
|---|---|
| In progress | The latest event is less than 30 minutes old, with no terminal outcome. Not a live-presence indicator. |
| Inactive | No event for at least 30 minutes, without an explicit terminal outcome. Inactivity is not proof of abandonment. |
| Abandoned | The latest event explicitly reports onboarding/signup abandonment. A subsequent resume can reopen the visit. |
| Ended | The latest event is logout. |
| Needs attention | The latest event reports failure, error, or timeout. A recovered earlier error does not keep this badge forever. |
| Completed | The visit contains signup completion, completed onboarding, agent creation, or an offer received, with no later terminal abandonment/logout/error. |
Duration is the interval between the first and last observed events in that visit, not a timer that continues while the user is away. A standalone event has zero duration. Separate uncorrelated server events cannot be safely joined to a browser visit just because they belong to the same person.