marketing-dashboard
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMarketing Dashboard
营销仪表盘
Unified CLI for marketing metrics. Built for quick status checks and deeper dives.
用于营销指标的统一CLI工具,专为快速状态检查和深度分析而构建。
Quick Start
快速开始
bash
./dashboard.py status
./dashboard.py seo --period 30d
./dashboard.py ads --period 7d
./dashboard.py revenue --period 90d
./dashboard.py funnelbash
./dashboard.py status
./dashboard.py seo --period 30d
./dashboard.py ads --period 7d
./dashboard.py revenue --period 90d
./dashboard.py funnelCommands
命令说明
- - Traffic (7d), revenue (30d), top errors
mktg status - - GSC clicks, impressions, avg position, top queries
mktg seo --period [7d|30d|90d] - - Spend, impressions, clicks, CPA by platform
mktg ads --period [7d|30d] - - MRR, churn, new subs, revenue by product
mktg revenue --period [30d|90d] - - Funnel: visit → signup → trial → paid
mktg funnel
- - 流量(7天)、收入(30天)、主要错误
mktg status - - GSC点击量、展示量、平均排名、热门搜索词
mktg seo --period [7d|30d|90d] - - 各平台的广告花费、展示量、点击量、单次获取成本(CPA)
mktg ads --period [7d|30d] - - 月度经常性收入(MRR)、客户流失率、新订阅数、按产品划分的收入
mktg revenue --period [30d|90d] - - 转化漏斗:访问 → 注册 → 试用 → 付费
mktg funnel
Environment
环境变量
| Variable | Purpose |
|---|---|
| PostHog API key |
| PostHog project id |
| Search Console property URL |
| Service account JSON path |
| Stripe API key |
| JSON file for ad platform metrics |
| Inline JSON for ad metrics |
| Comma list of PostHog events (default: |
| 环境变量 | 用途 |
|---|---|
| PostHog API密钥 |
| PostHog项目ID |
| Search Console属性URL |
| 服务账号JSON文件路径 |
| Stripe API密钥 |
| 广告平台指标JSON文件路径 |
| 内嵌式广告指标JSON数据 |
| PostHog事件逗号分隔列表(默认值: |
Ads JSON Shape
广告数据JSON格式
json
{
"google": {"spend": 123.45, "impressions": 10000, "clicks": 321, "cpa": 12.34},
"meta": {"spend": 98.76, "impressions": 9000, "clicks": 210, "cpa": 15.67}
}json
{
"google": {"spend": 123.45, "impressions": 10000, "clicks": 321, "cpa": 12.34},
"meta": {"spend": 98.76, "impressions": 9000, "clicks": 210, "cpa": 15.67}
}Files
文件说明
- - Click CLI entrypoint (
dashboard.py)mktg - - PostHog API wrapper via
src/posthog_client.pyhttpx - - Search Console wrapper via
src/gsc_client.py+google-authgoogleapiclient - - Stripe metrics wrapper
src/stripe_client.py - - Rich tables and formatting
src/display.py
- - Click CLI入口(
dashboard.py命令)mktg - - 基于
src/posthog_client.py的PostHog API封装httpx - - 基于
src/gsc_client.py+google-auth的Search Console封装googleapiclient - - Stripe指标封装工具
src/stripe_client.py - - 基于Rich库的表格与格式化工具
src/display.py
Notes
注意事项
- Prefer PostHog for traffic and funnel. Uses and
insights/trend.insights/funnel - GSC reads only. Requires Search Console access for the service account.
- Stripe metrics are computed from subscriptions and invoices; keep product naming consistent.
- 优先使用PostHog获取流量和漏斗数据,调用和
insights/trend接口。insights/funnel - GSC仅支持读取操作,需为服务账号配置Search Console访问权限。
- Stripe指标基于订阅和发票计算,请保持产品命名的一致性。