Langsung ke konten
Skillpedia
Analisis & spreadsheet41k Β· #6852

modeling-revenue-metrics

Fungsinya

Skill ini memodelkan ukuran pendapatan berulang dan total, termasuk MRR, ARR, churn, dan nilai seumur hidup, dari data penagihan atau event pendapatan. Ditujukan untuk tim keuangan dan pertumbuhan yang menginginkan angka pendapatan yang andal.

Kapan dipakai

  • βœ“Saat Anda ingin menghitung pendapatan berulang bulanan atau tahunan dari data penagihan Anda.
  • βœ“Saat Anda ingin melihat churn pendapatan, ekspansi, atau nilai seumur hidup per pelanggan.
  • βœ“Saat Anda ingin angka pendapatan yang berasal dari view pendapatan terkelola PostHog.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/PostHog/posthog/blob/master/products/data_modeling/skills/modeling-revenue-metrics/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œHitung pendapatan berulang bulanan dan churn kami untuk enam bulan terakhir dari data Stripe kami.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI menggunakan view pendapatan terkelola PostHog untuk platform penagihan yang terhubung, atau event pendapatan kustom jika tidak ada platform yang terhubung. Setelah itu, AI menghitung ukuran yang dipilih dan menyimpannya sebagai model yang dapat digunakan ulang, sehingga angkanya tetap konsisten.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Apakah saya memerlukan Stripe?

Saat ini Stripe didukung sebagai sumber penagihan. Tanpa platform yang didukung, Anda dapat mengirim pendapatan sebagai event kustom.

Apakah pendapatan sebaiknya dihitung dari tabel penagihan mentah?

Tidak. View terkelola sudah menangani pengakuan pendapatan dan mata uang, sehingga skill menggunakannya alih-alih tabel mentah.

Ukuran pendapatan apa saja yang dapat dihitung?

Skill mencakup pendapatan berulang seperti MRR dan ARR, pendapatan baru, ekspansi, dan churn, rata-rata pendapatan per pengguna, serta nilai seumur hidup.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
41k
Peringkat
#6852
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa