Segment customers into cohorts — by acquisition period, channel, first behavior, or revenue tier — and produce a color-coded retention matrix, overlaid retention curves, LTV-by-cohort comparisons with LTV:CAC where cost data exists, best/worst cohort rankings with hypothesized drivers, stabilization-point analysis, and intervention recommendations for underperformers. Analyzes and recommends; it launches nothing. Triggers on \"/digital-marketing-pro:cohort-analysis\", \"are newer customers retai
git clone https://github.com/indranilbanerjee/digital-marketing-pro.git--- name: cohort-analysis description: "Segment customers into cohorts — by acquisition period, channel, first behavior, or revenue tier — and produce a color-coded retention matrix, overlaid retention curves, LTV-by-cohort comparisons with LTV:CAC where cost data exists, best/worst cohort rankings with hypothesized drivers, stabilization-point analysis, and intervention recommendations for underperformers. Analyzes and recommends; it launches nothing. Triggers on \"/digital-marketing-pro:cohort-analysis\", \"are newer customers retaining better than older ones\", \"which channel produces the highest-LTV customers\", \"build a retention matrix\", \"when does our churn stabilize\". Pulls customer data from connected CRM and analytics MCPs, reads the brand profile for business-model context, and saves the summary as a campaign-tracker.py insight for trend tracking." --- # /digital-marketing-pro:cohort-analysis ## Purpose Perform customer cohort analysis to understand lifecycle patterns, retention, and value over time. Segment customers into cohorts by acquisition date, channel, behavior, or value tier, then track retention curves, compare cohort performance, and identify which acquisition sources produce the highest-value customers. This analysis reveals whether the business is acquiring better or worse customers over time, which channels drive long-term value versus one-time transactions, and where lifecycle interventions (onboarding improvements, re-engagement campaigns, loyalty programs) would have the greatest impact on retention and revenue. ## Input Required The user must provide (or will be prompted for): - **Cohort type**: `time-based` (customers grouped by acquisition week, month, or quarter — the standard cohort analysis showing retention evolution over time), `channel-based` (customers grouped by acquisition source — paid search, organic, social, email, referral — revealing which channels produce the most durable customers), `behavioral` (customers grouped by first action taken — e.g., product category purchased, feature used, content consumed — identifying which entry points lead to highest retention), or `revenue-tier` (customers grouped by initial purchase value — low, medium, high, enterprise — showing how starting value correlates with lifetime retention and expansion) - **Time period and granularity**: The analysis window and cohort size — weekly cohorts for the past 3 months (high resolution, best for fast-cycle businesses), monthly cohorts for the past 12 months (standard for most businesses), or quarterly cohorts for multi-year analysis (best for long-cycle B2B or subscription businesses). Granularity determines both how cohorts are defined and the retention interval measured - **Metrics to track**: Which outcomes to measure across cohorts — `retention rate` (percentage of cohort still active at each interval), `revenue` (cumulative and per-period revenue per customer), `LTV` (cumulative lifetime value with projected future value), `engagement` (login frequency, feature usage, content consumption), or multiple metrics simultaneously for a comprehensive lifecycle view - **Data source**: Where to pull customer data — `CRM` (deal data, customer records, lifecycle stages), `analytics` (website behavior, conversion events, session data), `product analytics` (feature usage, activation events, engagement metrics), or a combination of sources merged on customer identifier ## Process 1. **Load brand context**: Read `~/.claude-marketing/brands/_active-brand.json` for the active slug, then load `~/.claude-marketing/brands/{slug}/profile.json`. Extract business model (SaaS, eCommerce, B2B), typical customer lifecycle length, key retention metrics, and churn definition for the industry. Check for guidelines at `~/.claude-marketing/brands/{slug}/guidelines/_manifest.json`. If no brand exists, ask: "Set up a brand first (/digital-marketing-pro:brand-setup)?" — or proceed with defaults. 2. **Define cohorts based on selected type**: Segment the customer base into cohorts. For time-based: group customers by the week, month, or quarter they were first acquired (first purchase, account creation, or first meaningful interaction). For channel-based: group by the acquisition source attributed to their first conversion (UTM source, referral path, or CRM lead source field). For behavioral: group by the first significant action taken (first product category purchased, first feature activated, first content type consumed). For revenue-tier: group by initial transaction value bucketed into tiers (define thresholds based on the business's order value distribution — e.g., bottom 25%, middle 50%, top 25%). 3. **Pull customer data from CRM and analytics MCPs**: Gather the complete customer dataset — acquisition dates and source from CRM MCP, transaction history with timestamps and values, engagement events (logins, feature usage, email opens, site visits) from analytics MCPs, churn events (cancellation, last activity date, account closure), and any customer attributes needed for cohort segmentation. Merge data from multiple sources on customer identifier, resolving duplicates and filling gaps where possible. 4. **Build retention matrix**: For each cohort, calculate the retention rate at each subsequent time interval (Week 1, Week 2, Month 1, Month 2, etc. matching the selected granularity). Retention is defined as the percentage of the original cohort that performed a qualifying activity (purchase, login, engagement event — depending on the business model) during that interval. Present as a triangular matrix with cohorts as rows and time intervals as columns, with color-coded cells (green for above-average retention, red for below-average). 5. **Calculate LTV by cohort**: For each cohort, compute cumulative revenue per customer at each time interval — the average total revenue generated by a customer in that cohort from acquisition through that period. Plot LTV curves showing how value accumulates over time for each cohort. Calculate the LTV:CAC ratio where acquisition cost data is available, identifying which cohorts achieve payback fastest and which generate the highest long-term return. 6. **Identify retention patterns**: Analyze the retention matrix for structural patterns. When does retention stabilize (the "retention floor" — the period after which churn rate approaches zero)? Which cohorts retain best and what differentiates them from low-retention cohorts (acquisition channel, initial behavior, season of acquisition, promotional vs. organic)? Is there a critical activation window — a specific early-lifecycle period where retention diverges between customers who will retain and those who will churn? Identify the "aha moment" if behavioral data supports it. 7. **Calculate cohort health metrics**: For each cohort, compute: payback period (months until cumulative revenue exceeds acquisition cost), predicted LTV (extrapolated from the retention curve and revenue trend), churn rate (percentage lost per period, both gross and net), engagement score (composite of activity frequency and depth), and expansion revenue rate (for SaaS — percentage of revenue from upsells and cross-sells within the cohort). Rank cohorts by overall health combining these metrics. 8. **Save cohort data for trend tracking**: Persist the cohort analysis summary as an insight via `python "${CLAUDE_PLUGIN_ROOT}/scripts/campaign-tracker.py" --brand {slug} --action save-insight --data '{"type":"cohort","insight":"retention/LTV/health summary","context":"cohort-analysis {period}"}'` for longitudinal comparison — retention floor, LTV curve shape, cohort health scores, and segmentation notes. (Note: `churn-predictor.py` scores churn risk from behavioral signals; it does NOT store retention matrices or LTV curves — durable cohort history lives in campaign-tracker insights.) Enable month-over-month comparison of whether newer cohorts are retaining better or worse than older ones, whether channel quality is shifting, and whether lifecycle interventions are measurably improving retention curves. ## Output A structured cohort analysis containing: - **Retention matrix**: Cohort-by-time-period grid showing retention percentage at each interval — color-coded with above-average cells in green and below-average in red, with cohort size (n) displayed for each row to indicate statistical reliability - **Retention curves visualization data**: Plotted retention curves for each cohort overlaid on a single chart — enabling visual comparison of retention trajectory, with the average retention curve highlighted as a baseline reference - **LTV by cohort comparison**: Cumulative LTV curves per cohort showing value accumulation over time, with current LTV, projected 12-month LTV, and LTV:CAC ratio where acquisition cost is available - **Best and worst performing cohorts**: Ranked cohort list with the top 3 and bottom 3 cohorts by retention and LTV, with hypothesized drivers for each — acquisition channel, seasonal factors, promotional activity, product changes, or onboarding differences that correlate with performance - **Stabilization point analysis**: The retention floor for each cohort type — the time interval after which monthly churn drops below a threshold (typically 1-2%) — with implications for payback period planning and customer lifetime estimation - **Cohort trend analysis**: Are newer cohorts retaining better than older ones? Month-over-month comparison of same-interval retention rates across cohorts (e.g., Month 3 retention for each successive cohort) showing whether the business is improving or degrading at acquiring durable customers - **Intervention recommendations for underperforming cohorts**: Specific, actionable recommendations for improving retention in low-performing segments — targeted re-engagement campaigns, onboarding modifications, product experience improvements, or win-back offers, with projected retention impact based on the gap between underperforming and top-performing cohorts - **Acquisition channel quality ranking by cohort LTV**: Channels ranked by the average LTV of customers they acquire — revealing which channels drive long-term value versus which drive one-time or low-retention customers, independent of volume, to inform acquisition budget allocation ## Agents Used - **analytics-analyst** — Cohort definition and segmentation logic, retention matrix computation at each time interval, LTV curve calculation with cumulative revenue per customer, retention pattern identification including stabilization points and critical activation windows, cohort health metric computation (payback period, predicted LTV, churn rate, engagement score), trend analysis comparing newer versus older cohort performance, and data quality assessment with cohort size validation for statistical reliability - **crm-manager** — CRM data extraction including customer acquisition dates, transaction histories, lifecycle stage progressions, and churn events via CRM MCP, customer segmentation by acquisition source and value tier using CRM fields, and cross-referencing CRM deal data with analytics touchpoint data to build unified customer profiles for cohort assignment
[{"step":"Prepare your data. Export customer data from your CRM or analytics tool (e.g., HubSpot, Salesforce, or Mixpanel) with columns for acquisition date, cohort dimension (e.g., signup source), secondary dimensions (e.g., region), and the metric to analyze (e.g., retention rate or ARPU). Ensure the data covers at least 6 months of activity.","tip":"Use a tool like Excel or Google Sheets to clean the data first. Remove outliers (e.g., customers with <1 day of activity) and standardize date formats (e.g., YYYY-MM-DD)."},{"step":"Paste the prompt template into your AI tool (e.g., Claude, ChatGPT, or Perplexity) and replace the placeholders with your specific data. For example: '[DATASET]' → 'HubSpot export for Q1 2023 SaaS customers'; '[METRIC]' → 'customer retention'; '[COHORT_DIMENSION]' → 'acquisition month'.","tip":"If your data is large (>10,000 rows), summarize it first (e.g., pivot tables in Excel) or ask the AI to focus on a subset (e.g., 'Analyze only customers from North America')."},{"step":"Review the AI’s output and validate the insights against your domain knowledge. Check for anomalies (e.g., a cohort with unusually high retention) and ask the AI to dig deeper if needed (e.g., 'Why did the January cohort perform so well? Analyze the top 3 acquisition channels for this group.').","tip":"Cross-reference the AI’s recommendations with your team’s qualitative feedback (e.g., customer interviews or support tickets) to ensure the insights are actionable."},{"step":"Create a follow-up task for your team based on the top insights. For example, if the AI identifies a retention issue in a specific cohort, assign a customer success manager to reach out to those customers with targeted interventions.","tip":"Use the AI’s output to update your OKRs or KPIs. For example, if the analysis shows a 15% retention lift from LinkedIn ads, set a goal to increase LinkedIn ad spend by 20% next quarter."},{"step":"Monitor the impact of your actions over time. Re-run the cohort analysis monthly to track whether the changes (e.g., new onboarding emails) are improving retention or ARPU.","tip":"Set up automated dashboards (e.g., in Tableau or Power BI) to visualize cohort trends in real time. Share these with stakeholders weekly."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/indranilbanerjee/digital-marketing-pro/tree/main/skills/cohort-analysisCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Perform a cohort analysis on [DATASET] to identify trends in [METRIC, e.g., customer retention, revenue, or engagement] across [COHORT_DIMENSION, e.g., acquisition month, signup source, or product tier]. Break down the results by [SECONDARY_DIMENSION, e.g., geography, customer segment, or pricing plan] and highlight the top 3 insights with actionable recommendations for [TEAM, e.g., marketing, product, or customer success]. Include a retention curve for the strongest and weakest cohorts.
Here’s a cohort analysis of **Acme Corp’s SaaS platform** (fictional data) based on customer acquisition months (Jan–Jun 2023), measuring **6-month retention rates** and **average revenue per user (ARPU)**. The dataset includes 12,450 customers across 3 regions (North America, EMEA, APAC) and 2 pricing tiers (Basic, Pro). **Key Findings:** 1. **January 2023 Cohort (Best Performing):** - Retention: 68% (vs. 52% industry avg.) - ARPU: $420 (20% higher than Pro-tier avg.) - *Insight:* Customers acquired via LinkedIn ads (40% of cohort) had 15% higher retention. *Recommendation:* Double down on LinkedIn ads and replicate the onboarding flow for other cohorts. 2. **April 2023 Cohort (Worst Performing):** - Retention: 38% (14% below avg.) - ARPU: $290 (15% lower than Basic-tier avg.) - *Insight:* 60% of churn happened in the first 30 days, with 45% citing "lack of training" as the top reason. *Recommendation:* Launch a 7-day email drip campaign with video tutorials for new April customers. 3. **EMEA Region (Underperforming):** - Retention: 45% (10% below global avg.) - ARPU: $310 (12% lower than NA) - *Insight:* Customers in Germany and France had 22% lower engagement with the "Advanced Analytics" feature. *Recommendation:* Localize tutorials and highlight ROI case studies in these markets. **Retention Curve:** The January cohort retained 68% at 6 months, while the April cohort dropped to 38%. The curve flattens after month 3 for all cohorts, suggesting the onboarding experience is critical in the first 90 days. **Actionable Next Steps:** - Reallocate 20% of April’s marketing budget to LinkedIn ads (proven to work for high-retention cohorts). - Schedule a 1:1 call with the top 10% of April churners to identify friction points in the onboarding flow. - Test a "Premium Onboarding Pack" (free for 30 days) for new EMEA customers.
skills-collection
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan