Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesAnalyticsAnalytics

Analytics

Owner/admin analytics has the existing summary/agent analytics and TKN-24 basic reports. Basic reports organize seven projections into three task-focused areas with a Studio KPI snapshot. They do not replace legacy summaries or their eight CSV exports. Report projections are read-only.

What

Existing summary analytics (unchanged)

All routes below are beneath /organizations/:orgId.

SurfaceEndpointService method
Revenue summaryGET /analytics/revenue/summarygetRevenueSummary
Revenue trendGET /analytics/revenue/trend?months=12getRevenueTrend
Plan distributionGET /analytics/revenue/plan-distributiongetPlanDistribution
Members summaryGET /analytics/members/summarygetMembersSummary
Members growthGET /analytics/members/growth?months=6getMembersGrowth
Members activationGET /analytics/members/activationgetMembersActivation
At-risk membersGET /analytics/members/at-risk?sample=5getAtRiskMembers
Popular classesGET /analytics/classes/popular?days=30&limit=10getPopularClasses
Class utilizationGET /analytics/classes/utilization?days=30getClassUtilization
Workouts summaryGET /analytics/workouts/summarygetWorkoutsSummary
Coach overviewGET /analytics/coaches/overviewgetCoachOverview
CSV exportGET /analytics/export?tab=<tab>per-tab payload → toCsv

Basic reports (TKN-24)

Basic reports are available to every organization, subject to analytics:view.

SurfaceEndpoint beneath /organizations/:orgId/analytics
Five Studio KPIsGET /dashboard
Attendance, ranking, capacityGET /attendance/report?from&to&classTypeId?
Receipts, methods, monthly revenueGET /revenue/report?from&to&method?
Membership lifecycle cohortsGET /members/cohorts?months=6&asOf?
Matching CSV projectionsGET /export?tab=<report-tab> with the same filters

The localized /[lang]/dashboard/analytics workspace has four areas: Attendance (attendance, class ranking, capacity), Revenue (currency totals, methods, monthly revenue), Retention (membership cohorts), and Trials (trial funnel and breakdowns, see Trials). Each area shares one report dataset fetch across its projections; the three original areas keep their CSV exports, Trials has none. The sidebar entry appears for analytics:view holders. OverviewV2 has no Studio snapshot or report link and does not initiate their report requests; its existing panels remain. English, Hebrew (RTL), and Russian are supported; query errors are not displayed as zeros.

The URL is the source of truth: tab=attendance|revenue|retention|trials plus from, to, classTypeId, method, months, and asOf. Direct links, reload, and back/forward hydrate the same state; implicit org-local defaults are pinned into the URL, and invalid relevant filters block dataset requests and exports rather than silently broadening them. See the exact URL and projection map.

Reports use inclusive org-local dates (maximum 366 days; DST-aware) and membership cohort horizons of 1–12 months. Revenue reuses canonical payments/services/receipts.sql.ts for signed settled receipts, with each currency kept separate and no FX total; it is not MRR. Membership cohorts estimate lifecycle continuity, not historical paid retention. See behavior for exact definitions and accounting audit deferrals, and QA for verification and limits. TKN-24 requires no new table or migration.

Why

  • Owners track the gym as a business. Without revenue, MRR, debt, churn, and class utilization in one place, they fall back on spreadsheets.
  • The same metrics power the Spotter agent’s analytics.* tool family — agent answers like “how’s the gym doing?” pull from this service.
  • Keeping every query close to the operational tables means metrics never lag — there is no nightly aggregation job that could drift.

Who

  • Owner / admin — requireMembership plus PermissionsService enforcement of analytics:view, for legacy summaries and basic report data/exports alike.
  • Coach / member — no access (403).
  • Spotter agent — staff-only via the agent tools.

Persona impact

PersonaImpact
OwnerTask-focused attendance, revenue, and retention alongside existing summaries; seven basic projection CSVs.
AdminSame as owner.
CoachBroader analytics endpoints are locked; the separate coaching dashboard is not access to owner/admin reports.

Existing summary capabilities

Revenue

  • MRR computation normalized by plan interval (INTERVAL_MONTHS mapping in analytics.service.ts).
  • Month-over-month delta percentages on MRR and collected revenue.
  • Outstanding receivables (subscriptions with debt > 0).
  • 12-month trend by month-start bucket; configurable horizon.
  • Plan distribution: active subs per plan with monthly revenue contribution.

Members

  • Total / active / activated-active counts (the activatedActive discriminator distinguishes Clerk-linked from CSV-imported members).
  • New + churned this month with MoM deltas.
  • Activation funnel (imported → invited → activated).
  • At-risk sample (past-due subscriptions) with ?sample=N cap.
  • Growth trend over configurable months.

Classes

  • Most-booked class types over a window.
  • Capacity fill rate per class type plus a roll-up.

Workouts

  • Assignments scheduled / completed MTD, PRs MTD.

Coach overview

  • Per-coach panel: assigned athletes, recent activity, programming load.

CSV exports

  • Per-tab synchronous CSV via GET /analytics/export?tab=... — handler builds the same rows the dashboard renders, then writes them as CSV with Content-Disposition: attachment.
  • Insights — ActionCenter owns actionable follow-up, including birthdays; the agent’s org_insights tool delegates to it.
  • payments / subscriptions — source of all revenue metrics.
  • memberships / users — source of growth + activation metrics.
  • class-sessions / bookings / class-types — source of class metrics.
  • workouts / workout-assignments / workout-results — source of workout metrics.
  • spotter-agent — existing analytics.* tools use legacy summaries; TKN-24 does not add report tools.

Status

TKN-24 reports are implemented with three basic areas and seven projection/export identifiers, available to every organization. Legacy summary analytics and exports are preserved. QA lists the regression commands; local verification is not production or full responsive certification.

Arbox category disposition

This is a scope map, not a parity checklist:

CategoryDisposition
Attendance / class ranking / capacityCovered by Attendance reports over ended sessions and historical bookings.
Members / revenue / retentionExisting member summaries, growth, and activation remain; Revenue covers actual receipts; Retention covers lifecycle cohorts, not paid retention.
BirthdaysActionCenter follow-up action, not another report.
Staff attendance / staff actionsDeliberate gap; historical member bookings that now belong to staff do not constitute a staff attendance or audit report.
External-subscriber attendanceDeliberate gap; current external occupancy is not a reliable historical attendance source.
Referral / blocked / duplicate usersDeliberate gaps; no report added for nominal parity.

Only measured, actionable gaps with reliable sources become report candidates. This consolidation does not expand into an Arbox parity checklist.

Gaps

  • All metrics are computed on-read without a reporting cache or pre-aggregated rollups. Local smoke does not establish production latency or scale.
  • Cohorts are lifecycle estimates only: no suspension/reactivation or historical paid-subscription ledger, LTV, or paid-retention curve.
  • Class utilization is over a fixed past window — no “next 30 days at current bookings pace” forecast.
  • CSV exports are synchronous; very large orgs may need the async queue path the members export uses.
  • No PostHog/Mixpanel-style event funnel — pure SQL aggregations on operational tables.
  • Accounting audit deferrals remain explicit in behavior: legacy scalar multi-currency summaries, PaymentAnalytics date windows, plan list-price distribution versus chargeable MRR, admin raw cross-org receipts, and historical paid-retention data. Reusing receipt SQL does not make every money API interchangeable.