Meta Ad Creatives
Track creative performance and hit rates across multiple Meta Ads accounts.
What This Skill Does
- - Calculate hit rates (% of creatives meeting performance benchmarks)
- Track multiple metrics: CPT (cost per trial), CPI (cost per install), IPM (installs per mille), ROAS
- Compare performance across multiple accounts
- Store historical data for trend analysis
- Identify winning creatives vs underperformers
- Support currency conversion for international accounts
Setup
1. Environment Variables
CODEBLOCK0
2. Accounts Configuration
Create accounts_config.json:
CODEBLOCK1
Configuration fields:
- -
account_id: Meta Ad Account ID (without act_ prefix) - INLINECODE3 : Campaign name filter (optional)
- INLINECODE4 : Geographic filter like "US" (optional)
- INLINECODE5 : CPT threshold for "winning" creatives
- INLINECODE6 : Human-readable benchmark description
Usage
Get Hit Rates for Current Month
CODEBLOCK2
Get Hit Rates for Previous Months
CODEBLOCK3
Get All-Time Aggregated Data
CODEBLOCK4
Get Individual Ad Performance
CODEBLOCK5
Monthly Comparison
CODEBLOCK6
Key Metrics
| Metric | Description |
|---|
| Total Ads | Ads created in the period |
| Ads with Spend |
Ads that received budget |
| Ads Hitting Benchmark | Ads meeting CPT threshold |
| Hit Rate | % of ads meeting benchmark |
| CPT | Cost Per Trial (spend / trials) |
Hit Rate Calculation
A creative "hits" the benchmark when:
- 1. It has spend > $0
- It has trials > 0
- CPT < benchmark_value (e.g., $100)
Hit Rate = (Ads Hitting Benchmark / Ads with Spend) × 100
Data Storage
The skill stores historical data for trend analysis:
- - Firestore (default for cloud deployments)
- SQLite (local fallback)
Set USE_FIRESTORE=false to use SQLite locally.
Common Questions This Answers
- - "What's our creative hit rate this month?"
- "Which creatives are winning for [Client]?"
- "How does this month compare to last month?"
- "Show me all ads that hit the benchmark"
- "What's our all-time hit rate?"
Meta广告素材
追踪多个Meta广告账户的素材表现和达标率。
技能功能
- - 计算达标率(达到表现基准的素材百分比)
- 追踪多项指标:CPT(单次试用成本)、CPI(单次安装成本)、IPM(每千次展示安装数)、ROAS
- 比较多个账户的表现
- 存储历史数据用于趋势分析
- 识别优胜素材与表现不佳素材
- 支持国际账户的货币转换
设置
1. 环境变量
bash
FACEBOOKACCESSTOKEN=yourtokenhere
FACEBOOKAPPID=yourappid
FACEBOOKAPPSECRET=yourappsecret
2. 账户配置
创建accounts_config.json:
json
{
accounts: {
ClientName: {
account_id: 123456789,
filter: CampaignNameFilter,
geo_filter: US,
benchmark_value: 100,
benchmark_display: CPT < $100,
active: true
}
}
}
配置字段说明:
- - accountid:Meta广告账户ID(不含act前缀)
- filter:广告系列名称筛选(可选)
- geofilter:地理筛选条件,如US(可选)
- benchmarkvalue:判定优胜素材的CPT阈值
- benchmark_display:人类可读的基准描述
使用方法
获取当月达标率
python
from scripts.metaadcreatives import getallhit_rates
data = getallhitrates(monthoffset=0)
print(f总体达标率:{data[totals][hit_rate]}%)
for account in data[accounts]:
print(f {account[accountname]}:{account[hitrate]}%)
获取历史月份达标率
python
上个月
data = get
allhit
rates(monthoffset=-1)
两个月前
data = get
allhit
rates(monthoffset=-2)
获取全部历史汇总数据
python
data = getallhitrates(alltime=True)
获取单个广告表现
python
from scripts.metaadcreatives import getindividualads
获取账户所有广告
ads = get
individualads(account
name=ClientName, monthkey=2026-01)
仅获取达标广告
winners = get
individualads(account
name=ClientName, hitonly=True)
按CPT排序
ads = get
individualads(sort_by=cpt)
月度对比
python
from scripts.metaadcreatives import getmonthlycomparison
对比最近3个月
months = get
monthlycomparison(num_months=3)
for month in months:
print(f{month[month
label]}:{month[totals][hitrate]}%)
关键指标
获得预算的广告数 |
| 达标广告 | 满足CPT阈值的广告数 |
| 达标率 | 达标广告占比 |
| CPT | 单次试用成本(花费/试用次数) |
达标率计算
素材达标的条件:
- 1. 花费 > $0
- 试用次数 > 0
- CPT < 基准值(如$100)
达标率 =(达标广告数 / 有花费广告数)× 100
数据存储
该技能存储历史数据用于趋势分析:
- - Firestore(云部署默认)
- SQLite(本地备用)
设置USE_FIRESTORE=false可在本地使用SQLite。
常见问题解答
- - 我们本月的素材达标率是多少?
- [客户]的哪些素材表现优异?
- 本月与上月相比如何?
- 显示所有达标的广告
- 我们的历史达标率是多少?