Home
cd ../playbooks
Data & ReportingIntermediate

Roi Calculator

Calculate marketing ROI.

15 minutes
By communitySource
#roi#calculator

Marketing teams lose hours to ad-hoc, inconsistent roi calculator work — Calculate marketing ROI. Use when: measuring campaign ROAS, CAC, CPL, LTV, or multi-channel attribution returns. This playbook turns the process into a repeatable, brand-aware workflow.

Who it's for: digital marketers, marketing managers, growth marketers

Example

"Run /roi-calculator for our brand" → Roi Calculator workflow output with brand context, structured inputs captured, process steps executed, and a complete deliverable ready for review.

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Roi Calculator

# /dm:roi-calculator

## Purpose

Campaign ROI calculator with multi-touch attribution models. Produces a comprehensive ROI analysis across channels for budget justification, optimization recommendations, and executive reporting.

## Input Required

The user must provide (or will be prompted for):

- **Campaign spend by channel**: Dollar amounts invested per channel (paid search, paid social, email, SEO, content, events, etc.)
- **Conversions and revenue by channel**: Number of conversions and total revenue attributed to each channel
- **Time period**: The date range for the analysis (week, month, quarter, year)
- **Attribution model preference**: Last-touch, first-touch, linear, time-decay, or position-based (or compare all models)
- **Customer LTV**: Optional -- average customer lifetime value for long-term ROI projection
- **Industry vertical**: For benchmark comparison context
- **Conversion definitions**: What counts as a conversion (purchase, lead, signup, demo request, trial start, etc.)
- **Cost inputs beyond ad spend**: Optional -- agency fees, tool costs, creative production costs, team time

## Process

1. **Load brand context**: Read `~/.claude-marketing/brands/_active-brand.json` for the active slug, then load `~/.claude-marketing/brands/{slug}/profile.json`. Apply voice, compliance, industry context. Check `guidelines/_manifest.json` for restrictions, messaging, channel styles, voice-and-tone rules, and templates. If a template matching this command exists in `~/.claude-marketing/brands/{slug}/templates/`, apply its format. If no brand exists, prompt for `/dm:brand-setup` or proceed with defaults.
2. **Check campaign history**: Run `python campaign-tracker.py --brand {slug} --action list-campaigns` to pull historical campaign data for trend comparison and period-over-period analysis.
3. **Run ROI calculator**: Execute `scripts/roi-calculator.py` with spend, revenue, and conversion data to compute channel-level and blended metrics.
4. **Calculate channel-level ROI and ROAS**: For each channel, compute ROI ((revenue - cost) / cost), ROAS (revenue / cost), CPA (cost / conversions), CPL (cost / leads), and contribution margin percentage.
5. **Apply attribution model**: Redistribute credit across channels using the selected attribution model. If the user wants a comparison, run all five models (last-touch, first-touch, linear, time-decay, position-based) and show how each model shifts credit between channels.
6. **Calculate blended ROI**: Aggregate all channels into a total campaign ROI, blended ROAS, and overall CPA. Factor in LTV if provided to project short-term vs long-term ROI and payback period.
7. **Compare against industry benchmarks**: Reference `skills/context-engine/industry-profiles.md` to contextualize whether channel performance is above, at, or below industry averages for the brand's vertical.
8. **Identify efficiency opportunities**: Flag channels with declining marginal returns, channels where increased spend could yield disproportionate gains, and channels where CPA exceeds LTV (unsustainable spend).
9. **Calculate payback period**: If LTV data is provided, compute the months to break even on customer acquisition cost per channel, identifying which channels pay back fastest and which require patience for long-term value.
10. **Model budget reallocation scenarios**: Generate 2-3 reallocation scenarios shifting budget from underperformers to high-performers, with projected impact on total ROI, total conversions, and blended CPA.
11. **Log results to campaign tracker**: Record the ROI analysis in `campaign-tracker.py` so future analyses can compare period-over-period trends and validate whether recommended reallocations improved performance.
12. **Compile executive report**: Format the analysis for stakeholder presentation with clear takeaways, data tables ready for visualization, and actionable next steps.

## Output

A structured ROI analysis report containing:

- Channel-by-channel performance table (spend, revenue, conversions, ROI, ROAS, CPA, CPL)
- Blended campaign ROI and overall ROAS with total spend and revenue summary
- Attribution model comparison showing credit distribution shifts across models
- LTV-adjusted ROI projection and payback period analysis (if customer LTV was provided)
- Industry benchmark comparison with above/at/below performance ratings per channel
- Efficiency analysis identifying diminishing returns and scaling opportunities
- Budget reallocation recommendations with 2-3 modeled scenarios and projected outcomes
- Underperforming channel diagnosis with specific improvement actions
- Period-over-period trend comparison (if historical data is available from campaign tracker)
- Executive summary with top 3 insights and recommended next steps
- Visualization-ready data tables formatted for Google Sheets or slide deck export

## Agents Used

- **analytics-analyst** -- ROI computation, attribution modeling, benchmark comparison, efficiency analysis, payback period calculation, and data-driven recommendations
- **marketing-strategist** -- Budget optimization strategy, channel mix recommendations, reallocation scenario design, and executive-level insight framing for stakeholder communication
README.md

What This Does

Campaign ROI calculator with multi-touch attribution models. Produces a comprehensive ROI analysis across channels for budget justification, optimization recommendations, and executive reporting.


Quick Start

Step 1: Create a Project Folder

Create a dedicated folder for this workflow (e.g. ~/marketing/roi-calculator).

Step 2: Download the Template

Click Download above and save the file as CLAUDE.md in that folder.

Step 3: Run the Workflow

Open the folder in Claude Code and describe your goal. Claude will prompt you for any missing inputs, follow the structured process, and produce a complete deliverable.


Inputs You'll Need

The user must provide (or will be prompted for):

  • Campaign spend by channel: Dollar amounts invested per channel (paid search, paid social, email, SEO, content, events, etc.)
  • Conversions and revenue by channel: Number of conversions and total revenue attributed to each channel
  • Time period: The date range for the analysis (week, month, quarter, year)
  • Attribution model preference: Last-touch, first-touch, linear, time-decay, or position-based (or compare all models)
  • Customer LTV: Optional -- average customer lifetime value for long-term ROI projection
  • Industry vertical: For benchmark comparison context
  • Conversion definitions: What counts as a conversion (purchase, lead, signup, demo request, trial start, etc.)
  • Cost inputs beyond ad spend: Optional -- agency fees, tool costs, creative production costs, team time

How It Works

  1. Load brand context: Read ~/.claude-marketing/brands/_active-brand.json for the active slug, then load ~/.claude-marketing/brands/{slug}/profile.json. Apply voice, compliance, industry context. Check guidelines/_manifest.json for restrictions, messaging, channel styles, voice-and-tone rules, and templates. If a template matching this command exists in ~/.claude-marketing/brands/{slug}/templates/, apply its format. If no brand exists, prompt for /dm:brand-setup or proceed with defaults.
  2. Check campaign history: Run python campaign-tracker.py --brand {slug} --action list-campaigns to pull historical campaign data for trend comparison and period-over-period analysis.
  3. Run ROI calculator: Execute scripts/roi-calculator.py with spend, revenue, and conversion data to compute channel-level and blended metrics.
  4. Calculate channel-level ROI and ROAS: For each channel, compute ROI ((revenue - cost) / cost), ROAS (revenue / cost), CPA (cost / conversions), CPL (cost / leads), and contribution margin percentage.
  5. Apply attribution model: Redistribute credit across channels using the selected attribution model. If the user wants a comparison, run all five models (last-touch, first-touch, linear, time-decay, position-based) and show how each model shifts credit between channels.
  6. Calculate blended ROI: Aggregate all channels into a total campaign ROI, blended ROAS, and overall CPA. Factor in LTV if provided to project short-term vs long-term ROI and payback period.
  7. Compare against industry benchmarks: Reference skills/context-engine/industry-profiles.md to contextualize whether channel performance is above, at, or below industry averages for the brand's vertical.
  8. Identify efficiency opportunities: Flag channels with declining marginal returns, channels where increased spend could yield disproportionate gains, and channels where CPA exceeds LTV (unsustainable spend).
  9. Calculate payback period: If LTV data is provided, compute the months to break even on customer acquisition cost per channel, identifying which channels pay back fastest and which require patience for long-term value.
  10. Model budget reallocation scenarios: Generate 2-3 reallocation scenarios shifting budget from underperformers to high-performers, with projected impact on total ROI, total conversions, and blended CPA.
  11. Log results to campaign tracker: Record the ROI analysis in campaign-tracker.py so future analyses can compare period-over-period trends and validate whether recommended reallocations improved performance.
  12. Compile executive report: Format the analysis for stakeholder presentation with clear takeaways, data tables ready for visualization, and actionable next steps.

What You Get

A structured ROI analysis report containing:

  • Channel-by-channel performance table (spend, revenue, conversions, ROI, ROAS, CPA, CPL)
  • Blended campaign ROI and overall ROAS with total spend and revenue summary
  • Attribution model comparison showing credit distribution shifts across models
  • LTV-adjusted ROI projection and payback period analysis (if customer LTV was provided)
  • Industry benchmark comparison with above/at/below performance ratings per channel
  • Efficiency analysis identifying diminishing returns and scaling opportunities
  • Budget reallocation recommendations with 2-3 modeled scenarios and projected outcomes
  • Underperforming channel diagnosis with specific improvement actions
  • Period-over-period trend comparison (if historical data is available from campaign tracker)
  • Executive summary with top 3 insights and recommended next steps
  • Visualization-ready data tables formatted for Google Sheets or slide deck export

$Related Playbooks

Data & Reporting

Automated Report Generator

Generate professional data reports with charts, tables, and visualizations

10 minutes
Intermediate
Data & Reporting

SaaS Metrics Dashboard

SaaS business metrics analysis - MRR, ARR, Churn, LTV, CAC, cohort analysis, and investor reporting

10 minutes
Advanced
Data & Reporting

Scientific Exploratory Data Analysis

Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically ...

10 minutes
Intermediate
Data & Reporting

Scientific Geomaster

Comprehensive geospatial science skill covering remote sensing, GIS, spatial analysis, machine learning for earth observation, and 30+ scientific domains. Supports satellite imagery processing (Sentinel, Landsat, MODIS, SAR, hyperspectral), vector...

5 minutes
Beginner
Data & Reporting

Scientific Geopandas

Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operat...

10 minutes
Intermediate
Data & Reporting

Scientific Hypogenic

Automated LLM-driven hypothesis generation and testing on tabular datasets. Use when you want to systematically explore hypotheses about patterns in empirical data (e.g., deception detection, content analysis). Combines literature insights with da...

15 minutes
Advanced
Data & Reporting

Scientific Infographics

'Create professional infographics using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Integrates research-lookup and web search for accurate data. Supports 10 infographic types, 8 industry styles, and co...

10 minutes
Intermediate
Data & Reporting

Scientific Matplotlib

Low-level plotting library for full customization. Use when you need fine-grained control over every plot element, creating novel plot types, or integrating with specific scientific workflows. Export to PNG/PDF/SVG for publication. For quick stati...

5 minutes
Beginner
Data & Reporting

Scientific Networkx

Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centra...

10 minutes
Intermediate
Data & Reporting

Scientific Plotly

Interactive visualization library. Use when you need hover info, zoom, pan, or web-embeddable charts. Best for dashboards, exploratory analysis, and presentations. For static publication figures use matplotlib or scientific-visualization.

5 minutes
Beginner
Data & Reporting

Scientific Polars

Fast in-memory DataFrame library for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory. Lazy evaluation, parallel execution, Apache Arrow backend. Best for 1-100GB datasets, ETL pipelines, faster pandas replacemen...

10 minutes
Intermediate
Data & Reporting

Scientific Dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For...

10 minutes
Intermediate

Browse all Data & Reporting playbooks →