Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Revenue Cohorts and Monetization Patterns | Cohort Analysis
Business Analytics and Decision Making with Python

bookRevenue Cohorts and Monetization Patterns

Understanding how much revenue each cohort generates over time is essential for evaluating the long-term value of your customers and the effectiveness of your monetization strategies. Revenue cohort analysis allows you to track how different groups of users—such as those who joined in the same month—contribute to your business financially as time progresses. By monitoring cumulative revenue by cohort, you can identify trends in user spending, assess the impact of product changes, and forecast future revenue more accurately. This approach is especially valuable for subscription services, e-commerce, and any business where customer lifetime value is a key metric.

123456789101112131415161718192021222324252627282930313233343536373839
import pandas as pd # Sample transaction data data = { "user_id": [1, 2, 1, 3, 2, 4, 3, 4], "order_date": [ "2024-01-15", "2024-01-20", "2024-02-10", "2024-01-25", "2024-02-13", "2024-02-20", "2024-03-01", "2024-03-15" ], "revenue": [100, 150, 80, 200, 120, 90, 110, 130] } df = pd.DataFrame(data) df["order_date"] = pd.to_datetime(df["order_date"]) # Assign cohort: month of user's first purchase df["cohort_month"] = df.groupby("user_id")["order_date"].transform("min").dt.to_period("M") # Add order_month for aggregation df["order_month"] = df["order_date"].dt.to_period("M") # Aggregate revenue per cohort and order month cohort_revenue = ( df.groupby(["cohort_month", "order_month"])["revenue"] .sum() .reset_index() ) # Calculate cohort period (months since cohort start) cohort_revenue["cohort_period"] = ( cohort_revenue["order_month"].astype(int) - cohort_revenue["cohort_month"].astype(int) + 1 ) # Calculate cumulative revenue per cohort over time cohort_revenue["cumulative_revenue"] = ( cohort_revenue.groupby("cohort_month")["revenue"] .cumsum() ) print(cohort_revenue[["cohort_month", "cohort_period", "cumulative_revenue"]])
copy
12345678910111213141516171819
import matplotlib.pyplot as plt # Assume cohort_revenue DataFrame from previous code sample for cohort in cohort_revenue["cohort_month"].unique(): cohort_data = cohort_revenue[cohort_revenue["cohort_month"] == cohort] plt.plot( cohort_data["cohort_period"], cohort_data["cumulative_revenue"], marker="o", label=str(cohort) ) plt.title("Cumulative Revenue by Cohort Over Time") plt.xlabel("Months Since Cohort Start") plt.ylabel("Cumulative Revenue") plt.legend(title="Cohort Month") plt.grid(True) plt.tight_layout() plt.show()
copy

When you analyze revenue curves by cohort, you gain insight into how quickly and sustainably different groups of users monetize. Steeper curves may indicate a successful product launch or an effective marketing campaign, while flatter curves can signal issues with user engagement or pricing. Comparing the shapes and heights of these curves helps you identify which cohorts are most valuable, spot the impact of pricing changes, and uncover seasonal or event-driven revenue patterns. This information is critical for making informed decisions about future product development, marketing investments, and revenue forecasting.

question mark

Why is analyzing revenue cohorts important for business decision making?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

bookRevenue Cohorts and Monetization Patterns

Veeg om het menu te tonen

Understanding how much revenue each cohort generates over time is essential for evaluating the long-term value of your customers and the effectiveness of your monetization strategies. Revenue cohort analysis allows you to track how different groups of users—such as those who joined in the same month—contribute to your business financially as time progresses. By monitoring cumulative revenue by cohort, you can identify trends in user spending, assess the impact of product changes, and forecast future revenue more accurately. This approach is especially valuable for subscription services, e-commerce, and any business where customer lifetime value is a key metric.

123456789101112131415161718192021222324252627282930313233343536373839
import pandas as pd # Sample transaction data data = { "user_id": [1, 2, 1, 3, 2, 4, 3, 4], "order_date": [ "2024-01-15", "2024-01-20", "2024-02-10", "2024-01-25", "2024-02-13", "2024-02-20", "2024-03-01", "2024-03-15" ], "revenue": [100, 150, 80, 200, 120, 90, 110, 130] } df = pd.DataFrame(data) df["order_date"] = pd.to_datetime(df["order_date"]) # Assign cohort: month of user's first purchase df["cohort_month"] = df.groupby("user_id")["order_date"].transform("min").dt.to_period("M") # Add order_month for aggregation df["order_month"] = df["order_date"].dt.to_period("M") # Aggregate revenue per cohort and order month cohort_revenue = ( df.groupby(["cohort_month", "order_month"])["revenue"] .sum() .reset_index() ) # Calculate cohort period (months since cohort start) cohort_revenue["cohort_period"] = ( cohort_revenue["order_month"].astype(int) - cohort_revenue["cohort_month"].astype(int) + 1 ) # Calculate cumulative revenue per cohort over time cohort_revenue["cumulative_revenue"] = ( cohort_revenue.groupby("cohort_month")["revenue"] .cumsum() ) print(cohort_revenue[["cohort_month", "cohort_period", "cumulative_revenue"]])
copy
12345678910111213141516171819
import matplotlib.pyplot as plt # Assume cohort_revenue DataFrame from previous code sample for cohort in cohort_revenue["cohort_month"].unique(): cohort_data = cohort_revenue[cohort_revenue["cohort_month"] == cohort] plt.plot( cohort_data["cohort_period"], cohort_data["cumulative_revenue"], marker="o", label=str(cohort) ) plt.title("Cumulative Revenue by Cohort Over Time") plt.xlabel("Months Since Cohort Start") plt.ylabel("Cumulative Revenue") plt.legend(title="Cohort Month") plt.grid(True) plt.tight_layout() plt.show()
copy

When you analyze revenue curves by cohort, you gain insight into how quickly and sustainably different groups of users monetize. Steeper curves may indicate a successful product launch or an effective marketing campaign, while flatter curves can signal issues with user engagement or pricing. Comparing the shapes and heights of these curves helps you identify which cohorts are most valuable, spot the impact of pricing changes, and uncover seasonal or event-driven revenue patterns. This information is critical for making informed decisions about future product development, marketing investments, and revenue forecasting.

question mark

Why is analyzing revenue cohorts important for business decision making?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
some-alt