Pular para o conteúdo
Skillpedia
Análise e planilhas41 mil · #6852

modeling-revenue-metrics

O que ela faz

Esta skill modela medidas de receita recorrente e total, incluindo MRR, ARR, churn e valor do tempo de vida, a partir de dados de cobrança ou de eventos de receita. É para times financeiros e de crescimento que querem números de receita confiáveis.

Quando usar

  • ✓Quando você quer calcular a receita recorrente mensal ou anual a partir dos seus dados de cobrança.
  • ✓Quando você quer ver churn de receita, expansão ou valor do tempo de vida por cliente.
  • ✓Quando você quer números de receita que venham das views gerenciadas de receita do PostHog.

Link da skill

https://github.com/PostHog/posthog/blob/master/products/data_modeling/skills/modeling-revenue-metrics/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/PostHog/posthog/blob/master/products/data_modeling/skills/modeling-revenue-metrics/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Calcule nossa receita recorrente mensal e o churn dos últimos seis meses a partir dos nossos dados do Stripe.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A IA usa as views gerenciadas de receita do PostHog para uma plataforma de cobrança conectada, ou eventos de receita personalizados se nenhuma plataforma estiver conectada. Depois calcula as medidas escolhidas e salva como modelos reutilizáveis, para que os números fiquem consistentes.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

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; copy-paste recipes in references/posthog/ and 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 manag
Perguntas frequentes

Preciso do Stripe?

Hoje o Stripe é suportado como fonte de cobrança. Sem uma plataforma compatível, você pode enviar a receita como eventos personalizados.

A receita deve ser calculada a partir de tabelas brutas de cobrança?

Não. As views gerenciadas já tratam o reconhecimento de receita e a moeda, então a skill as usa em vez das tabelas brutas.

Quais medidas de receita ela calcula?

Cobre receita recorrente, como MRR e ARR, receita nova, de expansão e perdida, receita média por usuário e valor do tempo de vida.

Detalhes

Descrição original do autor

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 event

repo: PostHog/posthog

Popularidade

Estrelas no GitHub
41 mil
Posição no ranking
#6852
Licença
—
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas