Build a cohort analysis system to track user behavior over time, measuring retention, engagement, and revenue by acquisition cohort.
You are a product analyst building a cohort analysis framework. Based on the following context, create a comprehensive cohort analysis system. Product Type: [SAAS/MOBILE APP/E-COMMERCE/MARKETPLACE/SUBSCRIPTION SERVICE] Cohort Definition: [HOW TO GROUP USERS - signup month, first purchase date, acquisition channel] Key Metrics: [RETENTION, REVENUE, ENGAGEMENT, FEATURE ADOPTION - LIST PRIMARY METRICS] Time Granularity: [DAILY/WEEKLY/MONTHLY COHORT PERIODS] Data Available: [DESCRIBE USER EVENT DATA, TRANSACTION DATA, AND ATTRIBUTE DATA] Analysis Goal: [WHAT BUSINESS QUESTION YOU ARE TRYING TO ANSWER] Build the cohort analysis across these six sections: 1. COHORT DEFINITION AND DATA PREPARATION Define the cohort framework precisely. Establish what event marks the start of a user's lifecycle and serves as the basis for cohort assignment. Handle edge cases such as users who churn and return, users with multiple accounts, and users who signed up but never activated. Build the SQL or Python code to construct the cohort assignment table from raw event data. Create a user-period activity matrix that indicates for each user and each period whether they were active and what metrics they generated. Address the incomplete cohort problem where the most recent cohort has not had enough time to mature and show how to handle it in analysis. 2. RETENTION COHORT ANALYSIS Build classic retention cohort triangles showing the percentage of each cohort that remains active in each subsequent period. Compute both period-over-period retention, which tracks surviving users from one period to the next, and anchor retention, which tracks the original cohort size. Create the retention heatmap visualization using Python with seaborn or matplotlib, with proper color scaling that makes patterns immediately visible. Calculate average retention curves across cohorts and identify statistically significant deviations. Provide SQL for computing retention directly in the data warehouse for large-scale datasets where pulling all data into Python is impractical. 3. REVENUE AND BEHAVIORAL COHORT ANALYSIS Extend beyond retention to analyze revenue and behavioral metrics by cohort. Build revenue cohort tables showing average revenue per user, cumulative lifetime value, and revenue retention which can differ significantly from user retention. Analyze behavioral metrics like sessions per user, features used, or transactions completed by cohort and period. Compute the activation rate for each cohort to understand what percentage of new users reach a meaningful milestone. Create a cohort-based LTV projection that estimates the long-term value of recent cohorts based on the matured behavior patterns of older cohorts using curve fitting. 4. COHORT COMPARISON AND SEGMENTATION Compare cohorts across different dimensions to identify what drives differences in retention and value. Segment cohorts by acquisition channel, geographic region, pricing plan, or initial behavior pattern. Build a comparative analysis that overlays retention curves from different segments on the same chart with confidence intervals. Use statistical tests to determine whether differences between segments are significant or within normal variation. Implement a cohort health index that combines multiple metrics into a single score for quickly comparing cohort quality. Create a waterfall chart showing how each factor contributes to differences between the best and worst performing cohorts. 5. PREDICTIVE COHORT MODELING Build models that predict cohort outcomes before they fully mature. Implement shifted beta-geometric or similar probabilistic models to forecast long-term retention from early cohort data. Use the observed behavior in the first one to two periods to predict which users within a cohort are likely to become long-term retained users versus those who will churn. Create an early warning system that detects when a new cohort is tracking below expectations based on comparison to historical cohort curves. Provide Python code for fitting parametric retention models and generating forecasts with uncertainty bands. 6. REPORTING AND ACTIONABLE INSIGHTS Translate cohort analysis into actionable business recommendations. Create an automated cohort report that refreshes regularly and highlights key trends. Build a product health dashboard centered on cohort metrics showing overall retention trend, latest cohort performance, and segment comparisons. Define a set of cohort-based alerts such as when the latest cohort's Day 7 retention drops below a threshold. Frame findings in terms of business actions: if onboarding cohorts show a retention drop, what product changes could address it? If a particular acquisition channel produces lower-quality cohorts, what does that mean for marketing budget allocation? Provide report templates suitable for product team meetings and executive reviews.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[WHAT BUSINESS QUESTION YOU ARE TRYING TO ANSWER]