Skip to content
Data
Skill

/modeling-revenue-metrics

Build reusable revenue models — MRR, ARR, gross revenue, new/expansion/contraction/churn, ARPU, LTV, and per-customer/per-account revenue — on either PostHog data-warehouse views (HogQL) or an external dbt project. Use when the user wants to model, define, or compute recurring

From plugin
posthog
41k172 skills11 agents2 commands3 MCP

Claude Code

$ npx -y skills add posthog/posthog --skill modeling-revenue-metrics --agent claude-code

SKILL.md

modeling-revenue-metrics.SKILL.md
name: modeling-revenue-metrics
description: >
  Build reusable revenue models — MRR, ARR, gross revenue, new/expansion/contraction/churn, ARPU, LTV, and
  per-customer/per-account revenue — on either PostHog data-warehouse views (HogQL) or an external dbt
  project. Use when the user wants to model, define, or compute recurring revenue, monthly/annual recurring
  revenue, churn or retention of revenue, lifetime value, average revenue per user, or revenue by customer,
  cohort, product, or currency. On PostHog, build on the managed *_revenue_view views (revenue_item,
  mrr, customer, subscription, charge, product) fed by Stripe or custom revenue events — not raw Stripe
  tables — and normalize money with convertCurrency(). In dbt, stage the payment source and compute
  fct_mrr / fct_revenue_item / dim_customer marts with tests. Covers picking the right source, the
  subscription-config gotcha that leaves MRR empty, currency handling, and linking revenue to persons/groups.
  Read modeling-warehouse-foundations first for the view-vs-dbt mechanics.

Modeling revenue metrics

Turn payment/subscription data into durable revenue models. Read `modeling-warehouse-foundations` first for the view-vs-dbt decision, the `view-*` workflow, and `convertCurrency()`; this skill is the revenue-specific layer on top. Metric definitions live in [`references/revenue-metric-definitions.md`](references/revenue-metric-definitions.md); copy-paste recipes in [`references/posthog/`](references/posthog/) and [`references/dbt/`](references/dbt/).

Step 1 — find where revenue lives

Revenue reaches PostHog two ways; both feed the same **managed revenue views**:

  • **A payment platform as a warehouse source** — Stripe today (Chargebee/Polar/RevenueCat coming). Best when

the business runs on a billing platform. Connect via `setting-up-a-data-warehouse-source`.

  • **Custom revenue events** — you send events (e.g. `purchase_completed`) with a revenue property. Best when

there's no supported platform or you already track revenue in-product.

If neither exists yet, use `suggesting-data-imports` to recommend a source. In **dbt**, the equivalent is staging whichever billing tables landed in the warehouse.

Step 2 — model on the managed views, not raw tables

PostHog auto-generates a curated set of views per source. **Do not re-derive revenue from raw Stripe tables** — the managed views already handle deferred-revenue recognition, currency, and a stable schema.

Each source gets its own views. There is no cross-source view. Names depend on the source type:

  • Warehouse source: `<source>.<prefix>.<kind>_revenue_view`, for example `stripe.prod.mrr_revenue_view`. The

`<prefix>.` part is absent when the source has no prefix.

  • Custom revenue events: `revenue_analytics.events.<event_name>.<kind>_events_revenue_view`, where every

non-alphanumeric character in the event name becomes `_`.

`<kind>` is one of the managed views in the table below. Discover the exact names. Do not search for `revenue_analytics`, because it does not match warehouse source views:

SELECT table_name FROM system.information_schema.tables
WHERE position(table_name, 'revenue_view') > 0 ORDER BY table_name

If this returns nothing, the project has no revenue source configured yet. Check the governed `mrr` metric (`metric-list`) or discover warehouse billing tables, and read their columns before modeling. Do not guess view names.

| Managed view | Grain | Use for | | ------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `revenue_item` (**start here**) | 1 / invoice line item | Gross revenue, monthly recurring revenue, revenue by product/customer/period. Implements deferred revenue + currency. | | `mrr` | 1 / (customer, subscription) | **Live snapshot** of current MRR — not a time series. | | `customer` | 1 / customer | `dim_customer`: email, country, cohort, metadata. | | `subscription` | 1 / subscription | Subscription state for churn/expansion logic. | | `charge` | 1 / charge | Raw charges; prefer `revenue_item` unless you specifically need charges. | | `product` | 1 / product | Product dimension. |

Key `revenue_item` columns: `amount` (already converted to the project **base currency**), `currency` (that base currency), `original_amount` / `original_currency` (as charged), `is_recurring`, `customer_id`, `subscription_id`, `product_id`, `group_0_key`…`group_4_key` (B2B account keys), `timestamp`.

Rules before you model (revenue gotchas)

1. **MRR is empty without a subscription config.** For event-based revenue, MRR only populates when a subscription property is configured. Empty MRR + populated gross revenue is **expected behaviour**, not a bug — say so instead of "fixing" it. 2. **The `mrr` managed view is a current snapshot**, not history ("MRR at the current time"). For MRR _over time_, sum recurring `amount` per month from `revenue_item` (see the recipe), or materialize a monthly snapshot of the `mrr` view on a schedule. 3. **`amount` is already in base currency.** Use it directly for reporting. Only call `convertCurrency(original_currency, 'XXX', original_amount, timestamp)` when you need a _different_ ta

Read more
@posthog
Ships withposthog

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

41k172 skills11 agents3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
40.7k
Star history of posthog/posthog on GitHub, a chart by star-history.com

Other skills on posthog.

mcp-servers

mcp-servers

Install, configure, authenticate, and troubleshoot MCP (Model Context Protocol) servers for this agent. Use when the user asks to…

@posthog@posthogInstall Skill
dynamic-workflows

dynamic-workflows

Designs and runs task-specific JavaScript harnesses with the `workflow` tool. Use for broad, long-running, highly structured, or…

@posthog@posthogInstall Skill
subagent-orchestration

subagent-orchestration

How and when to delegate work to subagents via the `subagent` tool (Explore, Plan, General). Use when a task involves codebase…

@posthog@posthogInstall Skill
checking-member-access

checking-member-access

Explains what a member or a role can do in a PostHog project, using the access control MCP tools. Use when the user asks what…

@posthog@posthogInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

@posthog@posthogInstall Skill
analyzing-expensive-users

analyzing-expensive-us…

Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top…

@posthog@posthogInstall Skill

More skills from other plugins.

context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem08d69k
@mem0ai@mem0aiInstall Skill
qmd

qmd

Search local markdown knowledge bases, notes, docs, and wikis with QMD. Use when users ask to find notes, retrieve documents,…

qmd4w31k
@tobi@tobiInstall Skill

Questions about modeling-revenue-metrics.

Which coding agents can use modeling-revenue-metrics?
modeling-revenue-metrics installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.