/agi-super-team:campaign-analyticsfrom agi-super-team
Analyzes campaign performance with multi-touch attribution, funnel conversion, and ROI calculation. CLI tools for marketing optimization.
Ships in agi-super-team. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Production-grade campaign performance analysis with multi-touch attribution modeling, funnel conversion analysis, and ROI calculation. Three Python CLI tools provide deterministic, repeatable analytics using standard library only -- no external dependencies, no API calls, no ML models.
All scripts accept a JSON file as positional input argument. See assets/sample_campaign_data.json for complete examples.
Reusable assets:
assets/ab_test_template.mdassets/campaign_report_template.mdassets/channel_comparison_template.mdassets/expected_output.jsonassets/sample_campaign_data.json{
"journeys": [
{
"journey_id": "j1",
"touchpoints": [
{"channel": "organic_search", "timestamp": "2025-10-01T10:00:00", "interaction": "click"},
{"channel": "email", "timestamp": "2025-10-05T14:30:00", "interaction": "open"},
{"channel": "paid_search", "timestamp": "2025-10-08T09:15:00", "interaction": "click"}
],
"converted": true,
"revenue": 500.00
}
]
}
{
"funnel": {
"stages": ["Awareness", "Interest", "Consideration", "Intent", "Purchase"],
"counts": [10000, 5200, 2800, 1400, 420]
}
}
{
"campaigns": [
{
"name": "Spring Email Campaign",
"channel": "email",
"spend": 5000.00,
"revenue": 25000.00,
"impressions": 50000,
"clicks": 2500,
"leads": 300,
"customers": 45
}
]
}
All scripts support two output formats via the --format flag:
--format text (default): Human-readable tables and summaries for review--format json: Machine-readable JSON for integrations and pipelines# Run all 5 attribution models
python scripts/attribution_analyzer.py campaign_data.json
# Run a specific model
python scripts/attribution_analyzer.py campaign_data.json --model time-decay
# JSON output for pipeline integration
python scripts/attribution_analyzer.py campaign_data.json --format json
# Custom time-decay half-life (default: 7 days)
python scripts/attribution_analyzer.py campaign_data.json --model time-decay --half-life 14
# Basic funnel analysis
python scripts/funnel_analyzer.py funnel_data.json
# JSON output
python scripts/funnel_analyzer.py funnel_data.json --format json
# Calculate ROI metrics for all campaigns
python scripts/campaign_roi_calculator.py campaign_data.json
# JSON output
python scripts/campaign_roi_calculator.py campaign_data.json --format json
Implements five industry-standard attribution models to allocate conversion credit across marketing channels:
| Model | Description | Best For |
|---|---|---|
| First-Touch | 100% credit to first interaction | Brand awareness campaigns |
| Last-Touch | 100% credit to last interaction | Direct response campaigns |
| Linear | Equal credit to all touchpoints | Balanced multi-channel evaluation |
| Time-Decay | More credit to recent touchpoints | Short sales cycles |
| Position-Based | 40/20/40 split (first/middle/last) | Full-funnel marketing |
Analyzes conversion funnels to identify bottlenecks and optimization opportunities:
Calculates comprehensive ROI metrics with industry benchmarking:
| Guide | Location | Purpose |
|---|---|---|
| Attribution Models Guide | references/attribution-models-guide.md | Deep dive into 5 models with formulas, pros/cons, selection criteria |
| Campaign Metrics Benchmarks | references/campaign-metrics-benchmarks.md | Industry benchmarks by channel and vertical for CTR, CPC, CPM, CPA, ROAS |
| Funnel Optimization Framework | references/funnel-optimization-framework.md | Stage-by-stage optimization strategies, common bottlenecks, best practices |
For a complete campaign review, run the three scripts in sequence:
# Step 1 -- Attribution: understand which channels drive conversions
python scripts/attribution_analyzer.py campaign_data.json --model time-decay
# Step 2 -- Funnel: identify where prospects drop off on the path to conversion
python scripts/funnel_analyzer.py funnel_data.json
# Step 3 -- ROI: calculate profitability and benchmark against industry standards
python scripts/campaign_roi_calculator.py campaign_data.json
Use attribution results to identify top-performing channels, then focus funnel analysis on those channels' segments, and finally validate ROI metrics to prioritize budget reallocation.
Before running scripts, verify your JSON is valid and matches the expected schema. Common errors:
journeys, funnel.stages, campaigns) -- script exits with a descriptive KeyErrorstages and counts must be the same length) -- raises ValueErrorTypeErrorUse python -m json.tool your_file.json to validate JSON syntax before passing it to any script.
| Problem | Likely Cause | Solution |
|---|---|---|
| Attribution model shows all credit on one channel | Using first-touch or last-touch on a multi-channel funnel | Switch to linear, time-decay, or position-based attribution. Compare at least 3 models to triangulate true channel value. GA4's data-driven attribution (DDA) is the recommended default for 2026 |
| Funnel conversion rate is unrealistically high or low | Mismatched stage definitions or counts array length error | Verify that stages and counts arrays are the same length and ordered top-to-bottom (largest count first). Ensure counts represent unique users at each stage, not cumulative events |
| ROI calculator flags all campaigns as underperforming | Channel name in JSON does not match built-in benchmark keys | Use exact channel names: email, paid_search, paid_social, display, organic_search, organic_social, referral, direct. Unrecognized channels fall back to default benchmarks |
| Time-decay model produces unexpected credit distribution | Half-life parameter does not match your sales cycle | Set --half-life to approximately half your average sales cycle length. For B2B SaaS (60-90 day cycles), use --half-life 30. For e-commerce (1-7 day cycles), use --half-life 3 |
| JSON parsing errors on script execution | Malformed JSON, trailing commas, or encoding issues | Validate JSON with python -m json.tool your_file.json before passing to any script. Ensure UTF-8 encoding and no BOM characters |
| GA4 attribution data does not match script output | Different lookback windows and model defaults | GA4 uses a 30-day lookback for acquisition and 90-day for engagement by default. DDA falls back to last-click when a key event has fewer than 400 conversions. Align your script's --half-life and data window to match GA4 settings |
| Campaign spend data shows zero ROI despite conversions | Revenue field missing or set to zero in input JSON | Ensure every campaign object includes a revenue field with actual attributed revenue. If revenue attribution is not available, use estimated values based on average deal size multiplied by customer count |
In Scope:
Out of Scope:
| Integration | Purpose | How to Connect |
|---|---|---|
| Google Analytics 4 (GA4) | Source of journey and conversion data | Export GA4 Exploration reports or use BigQuery export to generate journey JSON. GA4's DDA model (default in 2026) complements this skill's 5 models. Align lookback windows: GA4 defaults to 30-day acquisition / 90-day engagement |
| HubSpot | CRM attribution, lead scoring, deal data | Export HubSpot contact journey data with UTM parameters as JSON input. Use W-shaped (40-20-40) attribution for hybrid PLG/sales motions. Map HubSpot lifecycle stages to funnel analyzer stages |
| UTM Parameter Standards | Consistent campaign tagging | Enforce lowercase UTM values: utm_source={channel}, utm_medium={type}, utm_campaign={campaign-id}, utm_content={variant}, utm_term={keyword}. GA4 treats Email and email as separate entries |
| social-media-analyzer skill | Social channel performance data | Feed social media campaign metrics from calculate_metrics.py into campaign_roi_calculator.py for cross-channel ROI comparison |
| marketing-demand-acquisition skill | Demand gen campaign planning | Use attribution results to identify top-performing channels, then feed insights into demand gen budget allocation decisions |
| Business intelligence tools (Looker, Tableau, Power BI) | Dashboard visualization | Use --format json output from all three scripts for direct ingestion into BI tools. JSON output is structured for easy transformation |
| Spreadsheet tools (Excel, Google Sheets) | Manual analysis and reporting | Use --format text output for human-readable reports. Copy JSON output into spreadsheets for custom pivot analysis |
Type: CLI script with argparse
Usage:
python attribution_analyzer.py <input_file> [--model MODEL] [--half-life DAYS] [--format FORMAT]
| Flag | Required | Default | Description |
|---|---|---|---|
input_file | Yes | -- | Path to JSON file containing journey/touchpoint data. Must have a top-level journeys array |
--model | No | all 5 models | Run a specific model: first-touch, last-touch, linear, time-decay, position-based |
--half-life | No | 7.0 | Half-life in days for time-decay model. Set to ~half your average sales cycle |
--format | No | text | Output format: text (human-readable tables) or json (machine-readable) |
Input Schema: {"journeys": [{"journey_id": "str", "touchpoints": [{"channel": "str", "timestamp": "ISO-8601", "interaction": "str"}], "converted": bool, "revenue": float}]}
Output: Summary statistics (total journeys, conversion rate, total revenue, channels observed) plus per-model channel credit allocation with revenue and share percentages. Cross-model comparison table when running all models.
Type: CLI script with argparse
Usage:
python funnel_analyzer.py <input_file> [--format FORMAT]
| Flag | Required | Default | Description |
|---|---|---|---|
input_file | Yes | -- | Path to JSON file containing funnel data. Must have funnel (single) or segments (multi-segment) key |
--format | No | text | Output format: text or json |
Single Funnel Input: {"funnel": {"stages": ["Stage1", "Stage2", ...], "counts": [10000, 5200, ...]}}
Multi-Segment Input: {"stages": ["Stage1", "Stage2", ...], "segments": {"segment_a": {"counts": [...]}, "segment_b": {"counts": [...]}}}
Output: Stage-by-stage conversion rates, drop-off counts and percentages, cumulative conversion, bottleneck identification (both absolute and relative), and segment rankings when comparing multiple segments.
Type: CLI script with argparse
Usage:
python campaign_roi_calculator.py <input_file> [--format FORMAT]
| Flag | Required | Default | Description |
|---|---|---|---|
input_file | Yes | -- | Path to JSON file containing campaign data. Must have a top-level campaigns array |
--format | No | text | Output format: text or json |
Input Schema: {"campaigns": [{"name": "str", "channel": "str", "spend": float, "revenue": float, "impressions": int, "clicks": int, "leads": int, "customers": int}]}
Recognized Channels for Benchmarking: email, paid_search, paid_social, display, organic_search, organic_social, referral, direct. Unrecognized channels use default benchmarks.
Calculated Metrics: ROI %, ROAS, CPA, CPL, CAC, CTR %, CVR % (lead-to-customer), CPC, CPM, click-to-lead rate %, profit. Each campaign assessed against channel-specific benchmarks (low/target/high) with performance flags and recommendations.
Output: Portfolio summary (totals, blended metrics, top performer, flagged campaigns, channel breakdown) plus per-campaign detail with benchmark assessments, warning flags, and actionable recommendations.
assets/ab_test_template.md (opens in a new tab)assets/campaign_report_template.md (opens in a new tab)assets/channel_comparison_template.md (opens in a new tab)assets/expected_output.json (opens in a new tab)assets/sample_campaign_data.json (opens in a new tab)references/attribution-models-guide.md (opens in a new tab)references/campaign-metrics-benchmarks.md (opens in a new tab)references/funnel-optimization-framework.md (opens in a new tab)scripts/attribution_analyzer.py (opens in a new tab)scripts/campaign_roi_calculator.py (opens in a new tab)scripts/funnel_analyzer.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aaaaqwq/agi-super-team --plugin agi-super-team869 skills in this plugin
/5minbtcBTC 5分钟K线实时方向预测 + 币安预测市场错价套利(paper)。v6.0 真OFI驱动: 方向由当前K线原生 in-candle OFI 净流一票决定(ofi_n=2*(tb/v)-1, REST klines[9] 聚合, 零WS依赖; WS ofi.json 做新鲜度反转保护与交叉校准), 概率=P(close>open|ofi) 经验校准表+Bayesian shrink, edge=EV=p−ask 错价检测, 方向二选一无中性。13因子自v5.9起收敛到3个有证据信号且不再决定bias。黑天鹅防护: ATR spike+FNG<25。launchd 常驻 realtime/watch/trader。⚠️ Binance 端点**人工**双向切换(引擎为单端点硬依赖,无自动故障切换;2026-09-11 曾因 data-api SSL 失败静默断档 6h)。/sales-enablementWhen the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps.' Use this for any document or asset that helps a sales team close deals. For competitor comparison pages and battle cards, see competitor-alternatives. For marketing website copy, see copywriting. For cold outreach emails, see cold-email./accessibility-compliance-accessibility-auditYou are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.Other plugins' skills for the same job