marketing-analyst by borghei/claude-skills
npx skills add https://github.com/borghei/claude-skills --skill marketing-analyst该智能体扮演高级营销分析师的角色,提供营销活动绩效分析、多触点归因分析、营销组合建模、投资回报率衡量以及数据驱动的预算优化。
| 指标 | 公式 | 基准值 |
|---|---|---|
| CPL | 支出 / 潜在客户 | 因行业而异 |
| CAC | 销售与营销支出 / 新客户 | LTV/CAC > 3:1 |
| CPA | 支出 / 获客数 | 具体目标 |
| ROAS |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 收入 / 广告支出 |
| > 4:1 |
| 指标 | 公式 | 基准值 |
|---|---|---|
| 参与率 | 参与次数 / 展示次数 | 1-5% |
| CTR | 点击次数 / 展示次数 | 0.5-2% |
| 转化率 | 转化次数 / 访问者 | 2-5% |
| 跳出率 | 单页会话 / 总会话 | < 50% |
| 指标 | 公式 | 基准值 |
|---|---|---|
| 流失率 | 流失客户数 / 总客户数 | < 5% 每月 |
| NRR | (MRR - 流失 + 扩展收入) / MRR | > 100% |
| LTV | ARPU x 毛利率 x 生命周期 | 3倍+ CAC |
智能体应应用多种模型并比较结果,以识别渠道价值的高估或低估:
| 模型 | 逻辑 | 最适合 |
|---|---|---|
| 首次触点 | 100% 功劳归于首次互动 | 衡量品牌知名度渠道 |
| 末次触点 | 100% 功劳归于最终互动 | 衡量转化渠道 |
| 线性 | 所有触点平均分配功劳 | 完整客户旅程的平衡视图 |
| 时间衰减 | 更多功劳归于近期触点 | 短销售周期 |
| 基于位置 | 首次 40%,末次 40%,中间 20% | 大多数 B2B 场景 |
def calculate_attribution(touchpoints, model='position'):
"""Calculate attribution credit for a conversion journey.
Args:
touchpoints: List of channel names in order of interaction
model: One of 'first', 'last', 'linear', 'time_decay', 'position'
Returns:
Dict mapping channel -> credit (sums to 1.0)
Example:
>>> calculate_attribution(['paid_search', 'email', 'organic', 'direct'], 'position')
{'paid_search': 0.4, 'email': 0.1, 'organic': 0.1, 'direct': 0.4}
"""
n = len(touchpoints)
credits = {}
if model == 'first':
credits[touchpoints[0]] = 1.0
elif model == 'last':
credits[touchpoints[-1]] = 1.0
elif model == 'linear':
for tp in touchpoints:
credits[tp] = credits.get(tp, 0) + 1.0 / n
elif model == 'time_decay':
decay = 0.7
total = sum(decay ** i for i in range(n))
for i, tp in enumerate(reversed(touchpoints)):
credits[tp] = credits.get(tp, 0) + (decay ** i) / total
elif model == 'position':
if n == 1:
credits[touchpoints[0]] = 1.0
elif n == 2:
credits[touchpoints[0]] = 0.5
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.5
else:
credits[touchpoints[0]] = 0.4
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.4
for tp in touchpoints[1:-1]:
credits[tp] = credits.get(tp, 0) + 0.2 / (n - 2)
return credits
# Campaign Analysis: Q1 2026 Product Launch
## Performance Summary
| Metric | Target | Actual | vs Target |
|--------------|---------|---------|-----------|
| Impressions | 500K | 612K | +22% |
| Clicks | 25K | 28.4K | +14% |
| Leads | 1,200 | 1,350 | +13% |
| MQLs | 360 | 410 | +14% |
| Pipeline | $1.2M | $1.45M | +21% |
| Revenue | $380K | $425K | +12% |
## Channel Breakdown
| Channel | Spend | Leads | CPL | Pipeline |
|--------------|---------|-------|-------|----------|
| Paid Search | $45K | 520 | $87 | $580K |
| LinkedIn Ads | $30K | 310 | $97 | $420K |
| Email | $5K | 380 | $13 | $350K |
| Content/SEO | $8K | 140 | $57 | $100K |
## Key Insight
Email delivers lowest CPL ($13) and strong pipeline. Recommend shifting
10% of LinkedIn budget to email nurture sequences for Q2.
Budget Allocation Recommendation
Channel Current Optimal Change Expected ROI
Paid Search 30% 35% +5% 4.2x
Social Paid 25% 20% -5% 2.8x
Display 15% 10% -5% 1.5x
Email 10% 15% +5% 8.5x
Content 10% 12% +2% 5.2x
Events 10% 8% -2% 2.2x
Projected Impact: +15% pipeline with same budget
from scipy import stats
import numpy as np
def analyze_ab_test(control_conv, control_total, treatment_conv, treatment_total, alpha=0.05):
"""Analyze A/B test for statistical significance.
Example:
>>> result = analyze_ab_test(150, 5000, 195, 5000)
>>> result['significant']
True
>>> f"{result['lift_pct']:.1f}%"
'30.0%'
"""
p_c = control_conv / control_total
p_t = treatment_conv / treatment_total
p_pool = (control_conv + treatment_conv) / (control_total + treatment_total)
se = np.sqrt(p_pool * (1 - p_pool) * (1/control_total + 1/treatment_total))
z = (p_t - p_c) / se
p_value = 2 * (1 - stats.norm.cdf(abs(z)))
return {
'control_rate': p_c,
'treatment_rate': p_t,
'lift_pct': ((p_t - p_c) / p_c) * 100,
'p_value': p_value,
'significant': p_value < alpha,
}
# Campaign analyzer
python scripts/campaign_analyzer.py --data campaigns.csv --output report.html
# Attribution calculator
python scripts/attribution.py --touchpoints journeys.csv --model position
# ROI calculator
python scripts/roi_calculator.py --spend spend.csv --revenue revenue.csv
# Forecast generator
python scripts/forecast.py --historical data.csv --periods 6
references/metrics.md - 营销指标指南references/attribution.md - 归因建模references/reporting.md - 报告最佳实践references/forecasting.md - 预测方法| 症状 | 可能原因 | 解决方案 |
|---|---|---|
| 归因模型给出的渠道功劳分配差异巨大 | 没有单一模型能捕捉全部真相;每个模型都有结构性偏差 | 运行 3 个以上模型(首次触点、末次触点、基于位置)并进行比较;对于 B2B 场景,默认使用基于位置模型 |
| ROAS 计算结果看起来很好,但销售线索没有增长 | 收入归因计算的是现有客户,而非新销售线索 | 将新业务归因与扩展业务归因分开;单独报告销售线索和收入 |
| 营销报告和销售报告显示的潜在客户数量不同 | 营销在表单填写时统计 MQL,销售在 CRM 录入时统计,且标准不同 | 就共享定义达成一致:在共享的服务水平协议中记录确切的 MQL、SQL 和商机标准 |
| 预测持续高估 20% 以上 | 模型使用线性外推,未考虑季节性因素或市场饱和 | 对长期预测应用衰减因子;使用集成方法(线性 + 增长率 + 移动平均) |
| 高管仪表板每月构建耗时过长 | 从 5 个以上平台手动提取数据,且模式不同 | 自动化数据收集;标准化 UTM 和命名约定,以确保跨平台分析的一致性 |
| 渠道 ROI 为负,但仍能产生销售线索 | B2B 销售周期长,意味着收入归因尚未赶上支出 | 对于销售周期超过 3 个月的渠道,使用基于销售线索的归因,而非基于已成交收入的归因 |
范围内: 营销活动绩效分析、多触点归因建模、营销组合优化、ROI/ROAS 计算、预算分配建议、高管报告、同期群留存分析、营销预测。
范围外: 分析实施和跟踪设置(请参阅 analytics-tracking 技能)、产品分析(请参阅 product-team 技能)、超出营销指标的财务建模(请参阅 finance 技能)、数据工程和数据仓库管理。
限制: 归因模型是近似值——没有任何模型能完美捕捉买家旅程,尤其是对于高接触度的 B2B 销售。预测使用带衰减的历史外推法;它不考虑市场中断或竞争性举措。预算优化假设渠道呈线性扩展;大多数渠道在规模扩大时存在收益递减效应。
| 脚本 | 用途 | 用法 |
|---|---|---|
scripts/channel_mix_optimizer.py | 分析渠道绩效并推荐最优预算分配 | python scripts/channel_mix_optimizer.py channels.json --budget 100000 --demo |
scripts/cohort_analyzer.py | 按同期群分析用户留存,识别趋势和最佳/最差表现者 | python scripts/cohort_analyzer.py cohort_data.json --demo |
scripts/marketing_forecast_generator.py | 使用线性、增长率和集成方法生成营销预测 | python scripts/marketing_forecast_generator.py historical.json --periods 6 |
每周安装数
145
仓库
GitHub 星标数
53
首次出现时间
Jan 24, 2026
安全审计
安装于
opencode121
gemini-cli116
claude-code115
codex114
github-copilot111
cursor106
The agent operates as a senior marketing analyst, delivering campaign performance analysis, multi-touch attribution, marketing mix modeling, ROI measurement, and data-driven budget optimization.
| Metric | Formula | Benchmark |
|---|---|---|
| CPL | Spend / Leads | Varies by industry |
| CAC | S&M Spend / New Customers | LTV/CAC > 3:1 |
| CPA | Spend / Acquisitions | Target specific |
| ROAS | Revenue / Ad Spend | > 4:1 |
| Metric | Formula | Benchmark |
|---|---|---|
| Engagement Rate | Engagements / Impressions | 1-5% |
| CTR | Clicks / Impressions | 0.5-2% |
| Conversion Rate | Conversions / Visitors | 2-5% |
| Bounce Rate | Single-page sessions / Total | < 50% |
| Metric | Formula | Benchmark |
|---|---|---|
| Churn Rate | Lost Customers / Total | < 5% monthly |
| NRR | (MRR - Churn + Expansion) / MRR | > 100% |
| LTV | ARPU x Gross Margin x Lifetime | 3x+ CAC |
The agent should apply multiple models and compare results to identify channel over/under-valuation:
| Model | Logic | Best For |
|---|---|---|
| First-touch | 100% credit to first interaction | Measuring awareness channels |
| Last-touch | 100% credit to final interaction | Measuring conversion channels |
| Linear | Equal credit across all touches | Balanced view of full journey |
| Time-decay | More credit to recent touches | Short sales cycles |
| Position-based | 40% first, 40% last, 20% middle | Most B2B scenarios |
def calculate_attribution(touchpoints, model='position'):
"""Calculate attribution credit for a conversion journey.
Args:
touchpoints: List of channel names in order of interaction
model: One of 'first', 'last', 'linear', 'time_decay', 'position'
Returns:
Dict mapping channel -> credit (sums to 1.0)
Example:
>>> calculate_attribution(['paid_search', 'email', 'organic', 'direct'], 'position')
{'paid_search': 0.4, 'email': 0.1, 'organic': 0.1, 'direct': 0.4}
"""
n = len(touchpoints)
credits = {}
if model == 'first':
credits[touchpoints[0]] = 1.0
elif model == 'last':
credits[touchpoints[-1]] = 1.0
elif model == 'linear':
for tp in touchpoints:
credits[tp] = credits.get(tp, 0) + 1.0 / n
elif model == 'time_decay':
decay = 0.7
total = sum(decay ** i for i in range(n))
for i, tp in enumerate(reversed(touchpoints)):
credits[tp] = credits.get(tp, 0) + (decay ** i) / total
elif model == 'position':
if n == 1:
credits[touchpoints[0]] = 1.0
elif n == 2:
credits[touchpoints[0]] = 0.5
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.5
else:
credits[touchpoints[0]] = 0.4
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.4
for tp in touchpoints[1:-1]:
credits[tp] = credits.get(tp, 0) + 0.2 / (n - 2)
return credits
# Campaign Analysis: Q1 2026 Product Launch
## Performance Summary
| Metric | Target | Actual | vs Target |
|--------------|---------|---------|-----------|
| Impressions | 500K | 612K | +22% |
| Clicks | 25K | 28.4K | +14% |
| Leads | 1,200 | 1,350 | +13% |
| MQLs | 360 | 410 | +14% |
| Pipeline | $1.2M | $1.45M | +21% |
| Revenue | $380K | $425K | +12% |
## Channel Breakdown
| Channel | Spend | Leads | CPL | Pipeline |
|--------------|---------|-------|-------|----------|
| Paid Search | $45K | 520 | $87 | $580K |
| LinkedIn Ads | $30K | 310 | $97 | $420K |
| Email | $5K | 380 | $13 | $350K |
| Content/SEO | $8K | 140 | $57 | $100K |
## Key Insight
Email delivers lowest CPL ($13) and strong pipeline. Recommend shifting
10% of LinkedIn budget to email nurture sequences for Q2.
Budget Allocation Recommendation
Channel Current Optimal Change Expected ROI
Paid Search 30% 35% +5% 4.2x
Social Paid 25% 20% -5% 2.8x
Display 15% 10% -5% 1.5x
Email 10% 15% +5% 8.5x
Content 10% 12% +2% 5.2x
Events 10% 8% -2% 2.2x
Projected Impact: +15% pipeline with same budget
from scipy import stats
import numpy as np
def analyze_ab_test(control_conv, control_total, treatment_conv, treatment_total, alpha=0.05):
"""Analyze A/B test for statistical significance.
Example:
>>> result = analyze_ab_test(150, 5000, 195, 5000)
>>> result['significant']
True
>>> f"{result['lift_pct']:.1f}%"
'30.0%'
"""
p_c = control_conv / control_total
p_t = treatment_conv / treatment_total
p_pool = (control_conv + treatment_conv) / (control_total + treatment_total)
se = np.sqrt(p_pool * (1 - p_pool) * (1/control_total + 1/treatment_total))
z = (p_t - p_c) / se
p_value = 2 * (1 - stats.norm.cdf(abs(z)))
return {
'control_rate': p_c,
'treatment_rate': p_t,
'lift_pct': ((p_t - p_c) / p_c) * 100,
'p_value': p_value,
'significant': p_value < alpha,
}
# Campaign analyzer
python scripts/campaign_analyzer.py --data campaigns.csv --output report.html
# Attribution calculator
python scripts/attribution.py --touchpoints journeys.csv --model position
# ROI calculator
python scripts/roi_calculator.py --spend spend.csv --revenue revenue.csv
# Forecast generator
python scripts/forecast.py --historical data.csv --periods 6
references/metrics.md - Marketing metrics guidereferences/attribution.md - Attribution modelingreferences/reporting.md - Reporting best practicesreferences/forecasting.md - Forecasting methods| Symptom | Likely Cause | Resolution |
|---|---|---|
| Attribution models give wildly different channel credit allocations | No single model captures full truth; each has structural bias | Run 3+ models (first-touch, last-touch, position-based) and compare; use position-based as default for B2B |
| ROAS calculations look great but pipeline is flat | Revenue attribution counting existing customers, not new pipeline | Separate new business attribution from expansion; report pipeline separately from revenue |
| Marketing reports and sales reports show different lead counts | Marketing counts MQLs at form fill, sales counts at CRM entry with different criteria | Align on shared definitions: document exact MQL, SQL, and opportunity criteria in a shared SLA |
| Forecast consistently over-predicts by 20%+ | Model uses linear extrapolation without accounting for seasonality or saturation | Apply dampening factors for longer forecasts; use ensemble method (linear + growth rate + moving average) |
| Executive dashboard takes too long to build each month | Manual data pulls from 5+ platforms with different schemas | Automate data collection; standardize UTM and naming conventions so cross-platform analysis is consistent |
| Channel ROI is negative but still generating pipeline | Long B2B sales cycle means revenue attribution has not caught up to spend |
In Scope: Campaign performance analysis, multi-touch attribution modeling, marketing mix optimization, ROI/ROAS calculation, budget allocation recommendations, executive reporting, cohort retention analysis, marketing forecasting.
Out of Scope: Analytics implementation and tracking setup (see analytics-tracking skill), product analytics (see product-team skills), financial modeling beyond marketing metrics (see finance skill), data engineering and warehouse management.
Limitations: Attribution models are approximations — no model perfectly captures the buyer journey, especially for high-touch B2B sales. Forecasting uses historical extrapolation with dampening; it does not account for market disruptions or competitive moves. Budget optimization assumes linear channel scaling; most channels have diminishing returns at scale.
| Script | Purpose | Usage |
|---|---|---|
scripts/channel_mix_optimizer.py | Analyze channel performance and recommend optimal budget allocation | python scripts/channel_mix_optimizer.py channels.json --budget 100000 --demo |
scripts/cohort_analyzer.py | Analyze user retention by cohort, identify trends and best/worst performers | python scripts/cohort_analyzer.py cohort_data.json --demo |
scripts/marketing_forecast_generator.py | Generate marketing forecasts using linear, growth rate, and ensemble methods | python scripts/marketing_forecast_generator.py historical.json --periods 6 |
Weekly Installs
145
Repository
GitHub Stars
53
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode121
gemini-cli116
claude-code115
codex114
github-copilot111
cursor106
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
51,800 周安装
| Use pipeline-based attribution for channels with 3+ month sales cycles rather than closed-won revenue |