Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính41k · #6852

modeling-revenue-metrics

Skill này làm gì

Skill này xây dựng các chỉ số doanh thu định kỳ và tổng doanh thu, gồm MRR, ARR, tỷ lệ rời bỏ và giá trị vòng đời, từ dữ liệu thanh toán hoặc sự kiện doanh thu. Nó dành cho các nhóm tài chính và tăng trưởng muốn có con số doanh thu đáng tin cậy.

Khi nào nên dùng

  • ✓Khi bạn muốn tính doanh thu định kỳ hằng tháng hoặc hằng năm từ dữ liệu thanh toán.
  • ✓Khi bạn muốn xem tỷ lệ rời bỏ doanh thu, mở rộng hoặc giá trị vòng đời theo từng khách hàng.
  • ✓Khi bạn muốn con số doanh thu đến từ các view doanh thu được quản lý của PostHog.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/PostHog/posthog/blob/master/products/data_modeling/skills/modeling-revenue-metrics/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tính doanh thu định kỳ hằng tháng và tỷ lệ rời bỏ của chúng tôi trong sáu tháng qua từ dữ liệu Stripe.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI dùng các view doanh thu được quản lý của PostHog cho một nền tảng thanh toán đã kết nối, hoặc các sự kiện doanh thu tùy chỉnh nếu không có nền tảng nào được kết nối. Sau đó, AI tính các chỉ số đã chọn và lưu chúng thành mô hình có thể tái sử dụng, để các con số luôn nhất quán.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Tôi có cần Stripe không?

Hiện tại Stripe được hỗ trợ như một nguồn thanh toán. Nếu không có nền tảng được hỗ trợ, bạn có thể gửi doanh thu dưới dạng sự kiện tùy chỉnh.

Doanh thu có nên tính từ các bảng thanh toán thô không?

Không. Các view được quản lý đã xử lý việc ghi nhận doanh thu và tiền tệ, nên skill dùng chúng thay vì các bảng thô.

Skill có thể tính những chỉ số doanh thu nào?

Nó bao gồm doanh thu định kỳ như MRR và ARR, doanh thu mới, mở rộng và rời bỏ, doanh thu trung bình trên mỗi người dùng và giá trị vòng đời.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6852
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự