modeling-revenue-metrics

Builds reusable MRR, ARR, churn, and LTV revenue models on PostHog warehouse views or dbt projects.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill modeling-revenue-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modeling-revenue-metrics
Source: https://github.com/PostHog/posthog-foss/tree/main/products/data_modeling/skills/modeling-revenue-metrics
Command: npx skills add https://github.com/PostHog/posthog-foss --skill modeling-revenue-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Revenue metrics like MRR, ARR, churn, and LTV are easy to compute inconsistently — raw Stripe tables require deferred-revenue recognition, currency conversion, and subscription logic that teams repeatedly re-derive and get wrong. This Skill provides canonical metric definitions and tested recipes so every model computes the same number.

Core Features & Use Cases

  • Managed-view modeling on PostHog: Build HogQL views on the auto-generated revenue_analytics_* views (revenue_item, mrr, customer, subscription, charge, product) fed by Stripe or custom revenue events, with currency handled via convertCurrency().
  • dbt marts: Stage billing sources into fct_revenue_item, fct_mrr, and dim_customer models with deferred-revenue recognition, a dense customer-month spine, and schema tests.
  • Canonical metric definitions: Precise formulas for gross revenue, MRR, ARR, new/expansion/contraction/churn MRR, churn rate, ARPU, and LTV, plus the MRR movement bridge identity for validation.
  • Use Case: A data analyst connects Stripe to PostHog and needs monthly MRR over time. The Skill explains that the managed mrr view is only a live snapshot, then provides a HogQL recipe summing recurring revenue_item amounts per month, ready to materialize as a scheduled view.

Quick Start

Ask the assistant to build a monthly MRR and ARR model from your PostHog Stripe revenue data using the managed revenue_analytics views.

Frequently Asked Questions about modeling-revenue-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate MRR over time in PostHog?

Derive the MRR time series by summing recurring amounts per month from the managed revenue_item view, since the managed mrr view is only a live snapshot. Group by toStartOfMonth(timestamp) where is_recurring is true, then materialize the view on a daily schedule.

Why is my PostHog MRR empty when gross revenue is populated?

Empty MRR with populated gross revenue is expected behavior when no subscription property is configured for event-based revenue. MRR only populates once a subscription config exists, so this is not a bug to fix.

Should I model revenue from raw Stripe tables or PostHog managed views?

Model on the managed revenue_analytics_* views rather than raw Stripe tables. The managed views already handle deferred-revenue recognition, currency conversion to the project base currency, and provide a stable schema across sources.

How do I convert revenue to a different currency in dbt?

dbt has no equivalent of PostHog's convertCurrency() function, so supply a currency_rates seed table with daily rates to the base currency. Join rates by currency and month, and seed the base currency itself at rate 1.0 so base-currency rows resolve.

How do I link Stripe revenue to PostHog persons or groups?

Person-level revenue requires posthog_person_distinct_id metadata on the Stripe customer record. For B2B account-level revenue, use the group_0_key through group_4_key columns on the revenue_item view instead.

What is the difference between the managed mrr view and revenue_item?

The mrr view is a current snapshot of MRR per customer and subscription, not a historical time series. The revenue_item view holds one row per invoice line item with recognized amounts per month, making it the correct source for MRR trends and revenue reporting.