metaads

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Workflow Routing (SYSTEM PROMPT)

工作流路由(系统提示)

CRITICAL: Route to the correct workflow based on user intent.
When user needs to set up or configure Meta Ads API access: Examples: "set up meta ads", "connect meta ads", "configure facebook ads", "my token expired", "meta ads setup", credential errors from --check -> READ: ~/.claude/skills/MetaAds/workflows/Setup.md -> EXECUTE: Walk user through complete setup (Business Manager, App, token, .env)
When user wants to publish, create, or launch a campaign: Examples: "publish ads", "create campaign", "launch campaign", "upload ad images", "publish meta ads", "push this campaign to Meta", "create ad set" -> READ: ~/.claude/skills/MetaAds/workflows/PublishCampaign.md -> EXECUTE: Campaign publishing workflow -> If credentials fail, route to Setup.md first
When user wants to check performance, metrics, or analyze results: Examples: "check meta ad performance", "ROAS", "which ad is winning", "ad spend", "campaign metrics", "how are my ads doing", "audience breakdown", "creative performance" -> READ: ~/.claude/skills/MetaAds/workflows/AnalyzePerformance.md -> EXECUTE: Performance analysis workflow -> If credentials fail, route to Setup.md first
When user wants to manage campaigns (pause/resume/status): Examples: "pause campaign", "resume campaign", "campaign status", "list campaigns" -> Use
uv run ~/.claude/skills/MetaAds/tools/Publish.py
directly with --pause, --resume, --status, or --list

重要提示:根据用户意图路由到正确的工作流。
当用户需要设置或配置Meta Ads API访问权限时: 示例:"set up meta ads"、"connect meta ads"、"configure facebook ads"、"my token expired"、"meta ads setup"、--check命令返回的凭证错误 -> 读取: ~/.claude/skills/MetaAds/workflows/Setup.md -> 执行: 引导用户完成完整设置(商务管理平台、应用、令牌、.env文件)
当用户想要发布、创建或启动广告活动时: 示例:"publish ads"、"create campaign"、"launch campaign"、"upload ad images"、"publish meta ads"、"push this campaign to Meta"、"create ad set" -> 读取: ~/.claude/skills/MetaAds/workflows/PublishCampaign.md -> 执行: 广告活动发布工作流 -> 如果凭证验证失败,先路由到Setup.md
当用户想要查看效果、指标或分析结果时: 示例:"check meta ad performance"、"ROAS"、"which ad is winning"、"ad spend"、"campaign metrics"、"how are my ads doing"、"audience breakdown"、"creative performance" -> 读取: ~/.claude/skills/MetaAds/workflows/AnalyzePerformance.md -> 执行: 效果分析工作流 -> 如果凭证验证失败,先路由到Setup.md
当用户想要管理广告活动(暂停/恢复/状态查询)时: 示例:"pause campaign"、"resume campaign"、"campaign status"、"list campaigns" -> 直接使用
uv run ~/.claude/skills/MetaAds/tools/Publish.py
并添加--pause、--resume、--status或--list参数

When to Activate This Skill

何时激活此技能

Setup & Configuration (Category 0)

设置与配置(类别0)

  • "set up meta ads", "connect meta ads API", "configure facebook ads"
  • "meta ads setup", "how do I connect my ad account"
  • "my token expired", "token error", "can't access meta ads"
  • "refresh my meta token", "renew access token"
  • Any credential error from --check
  • "set up meta ads"、"connect meta ads API"、"configure facebook ads"
  • "meta ads setup"、"how do I connect my ad account"
  • "my token expired"、"token error"、"can't access meta ads"
  • "refresh my meta token"、"renew access token" --check命令返回的任何凭证错误

Campaign Publishing (Category 1)

广告活动发布(类别1)

  • "publish ads", "create campaign", "launch campaign"
  • "push this to Meta", "set up the campaign", "upload ad images"
  • "publish meta ads", "create ad set", "build the campaign"
  • "publish this campaign config", "go live with the ads"
  • "publish ads"、"create campaign"、"launch campaign"
  • "push this to Meta"、"set up the campaign"、"upload ad images"
  • "publish meta ads"、"create ad set"、"build the campaign"
  • "publish this campaign config"、"go live with the ads"

Performance Analysis (Category 2)

效果分析(类别2)

  • "check meta ad performance", "how are my ads doing"
  • "ROAS", "return on ad spend", "ad spend", "ad metrics"
  • "which ad is winning", "best performing ad"
  • "campaign metrics", "ad set performance", "creative performance"
  • "audience breakdown", "age/gender breakdown"
  • "CTR", "CPC", "CPM", "CPA", "cost per acquisition"
  • "check meta ad performance"、"how are my ads doing"
  • "ROAS"、"return on ad spend"、"ad spend"、"ad metrics"
  • "which ad is winning"、"best performing ad"
  • "campaign metrics"、"ad set performance"、"creative performance"
  • "audience breakdown"、"age/gender breakdown"
  • "CTR"、"CPC"、"CPM"、"CPA"、"cost per acquisition"

Campaign Management (Category 3)

广告活动管理(类别3)

  • "pause campaign", "resume campaign", "activate campaign"
  • "campaign status", "list campaigns", "show my campaigns"

  • "pause campaign"、"resume campaign"、"activate campaign"
  • "campaign status"、"list campaigns"、"show my campaigns"

Core Capabilities

核心功能

Guided Setup:
  • Complete walkthrough: Business Manager -> Developer App -> Token -> .env
  • Two token paths: System User (never expires) or User Token (60-day, with automated refresh)
  • Token exchange automation (agent runs the curl command)
  • Pixel setup guidance for conversion tracking
  • Error diagnosis with specific fixes for every common failure
Campaign Publishing:
  • Upload images from local directories to Meta
  • Create full campaign hierarchy (campaign -> ad set -> creative -> ad)
  • Advantage+ flexible creative with multiple images/texts/headlines
  • All objects created PAUSED for manual review
  • JSON config-driven for reproducible campaigns
Performance Analytics:
  • Account-level summary with DTC benchmarks (CTR, CPM, CPA, ROAS)
  • Campaign, ad set, and ad-level metrics
  • Daily trend analysis for campaign deep dives
  • Audience breakdowns (age, gender, platform, device)
  • Data sync to Analytics/meta-ads/ for cross-channel analysis
  • CSV export for spreadsheet analysis
Campaign Management:
  • List all campaigns with status
  • View campaign hierarchy (campaign -> ad sets -> ads)
  • Pause/resume campaigns

引导式设置:
  • 完整流程指引:商务管理平台 -> 开发者应用 -> 令牌 -> .env文件
  • 两种令牌路径:系统用户令牌(永不过期)或用户令牌(60天有效期,支持自动刷新)
  • 令牌交换自动化(Agent执行curl命令)
  • 转化追踪的Pixel设置指引
  • 针对常见故障的错误诊断与具体修复方案
广告活动发布:
  • 将本地目录中的图片上传至Meta
  • 创建完整的广告活动层级(活动 -> 广告组 -> 创意 -> 广告)
  • 支持Advantage+灵活创意,可配置多张图片/文案/标题
  • 创建的所有对象默认处于暂停状态,供人工审核
  • 基于JSON配置,支持可重复创建广告活动
效果分析:
  • 账户级汇总报告,附带DTC行业基准数据(CTR、CPM、CPA、ROAS)
  • 活动、广告组、广告层级的详细指标
  • 每日趋势分析,用于深入剖析广告活动
  • 受众细分分析(年龄、性别、平台、设备)
  • 数据同步至Analytics/meta-ads/,用于跨渠道分析
  • 支持导出CSV文件,供电子表格分析
广告活动管理:
  • 列出所有广告活动及其状态
  • 查看广告活动层级结构(活动 -> 广告组 -> 广告)
  • 暂停/恢复广告活动

Scripts

脚本

ScriptPurpose
tools/Publish.py
Campaign creation, image upload, pause/resume
tools/Analytics.py
Performance metrics, breakdowns, sync, export
Both scripts use PEP 723 inline dependencies — just run with
uv run
directly from the skill directory. No install or copy step needed.
脚本用途
tools/Publish.py
广告活动创建、图片上传、暂停/恢复
tools/Analytics.py
效果指标统计、细分分析、数据同步、导出
两个脚本均使用PEP 723内联依赖 — 直接从技能目录使用
uv run
运行即可,无需安装或复制步骤。

Usage

使用方法

Run scripts directly from the skill directory. They load
.env
from the current working directory (
Path.cwd()
), so run them from your project root:
bash
undefined
直接从技能目录运行脚本。脚本会从当前工作目录(
Path.cwd()
)加载
.env
文件,因此请从项目根目录运行:
bash
undefined

From your project root (where .env lives):

从项目根目录(.env文件所在位置)运行:

uv run ~/.claude/skills/MetaAds/tools/Publish.py --check uv run ~/.claude/skills/MetaAds/tools/Analytics.py --summary

**Prerequisites:** `uv` must be installed. If not: `curl -LsSf https://astral.sh/uv/install.sh | sh`

**Environment Variables (`.env`):**
| Variable | Required | Description |
|----------|----------|-------------|
| `META_ADS_ACCESS_TOKEN` | Yes | System User or long-lived User token |
| `META_ADS_ACCOUNT_ID` | Yes | Ad account ID with `act_` prefix |
| `FACEBOOK_APP_ID` | For refresh | App ID for token exchange |
| `FACEBOOK_APP_SECRET` | For refresh | App Secret for token exchange |

---
uv run ~/.claude/skills/MetaAds/tools/Publish.py --check uv run ~/.claude/skills/MetaAds/tools/Analytics.py --summary

**前置条件:** 必须安装`uv`。若未安装:`curl -LsSf https://astral.sh/uv/install.sh | sh`

**环境变量(`.env`):**
| 变量 | 是否必填 | 描述 |
|----------|----------|-------------|
| `META_ADS_ACCESS_TOKEN` | 是 | 系统用户令牌或长效用户令牌 |
| `META_ADS_ACCOUNT_ID` | 是 | 带有`act_`前缀的广告账户ID |
| `FACEBOOK_APP_ID` | 用于刷新 | 令牌交换所需的应用ID |
| `FACEBOOK_APP_SECRET` | 用于刷新 | 令牌交换所需的应用密钥 |

---

Campaign Objective Reference

广告活动目标参考

Use these objectives in campaign configs:
ObjectiveWhen to UseOptimization Goal
OUTCOME_SALES
DTC purchases, Shopify conversions
OFFSITE_CONVERSIONS
OUTCOME_LEADS
Lead gen, email signups, quiz funnels
LEAD_GENERATION
OUTCOME_TRAFFIC
Landing page visits, blog traffic
LINK_CLICKS
OUTCOME_AWARENESS
Brand awareness, video views
REACH
or
IMPRESSIONS
OUTCOME_ENGAGEMENT
Post engagement, page likes
POST_ENGAGEMENT

在广告活动配置中使用以下目标:
目标使用场景优化目标
OUTCOME_SALES
DTC电商购买、Shopify转化
OFFSITE_CONVERSIONS
OUTCOME_LEADS
线索生成、邮件订阅、问卷漏斗
LEAD_GENERATION
OUTCOME_TRAFFIC
落地页访问、博客流量
LINK_CLICKS
OUTCOME_AWARENESS
品牌曝光、视频观看
REACH
IMPRESSIONS
OUTCOME_ENGAGEMENT
帖子互动、主页点赞
POST_ENGAGEMENT

Campaign Config Template

广告活动配置模板

Generic template for any DTC brand:
json
{
  "campaign": {
    "name": "campaign-name-month-year",
    "objective": "OUTCOME_SALES"
  },
  "adsets": [
    {
      "name": "Broad-25-54-US",
      "daily_budget": 5000,
      "targeting": {
        "age_min": 25,
        "age_max": 54,
        "genders": [0],
        "geo_locations": {"countries": ["US"]},
        "publisher_platforms": ["facebook", "instagram"],
        "facebook_positions": ["feed", "video_feeds", "story", "reels"],
        "instagram_positions": ["stream", "story", "reels", "explore"]
      },
      "optimization_goal": "OFFSITE_CONVERSIONS",
      "bid_strategy": "LOWEST_COST_WITHOUT_CAP"
    }
  ],
  "creative": {
    "images_directory": "./path/to/ad-images/",
    "primary_texts": [
      "Primary text variant 1 — lead with the hook or pain point",
      "Primary text variant 2 — lead with the benefit or social proof",
      "Primary text variant 3 — lead with a comparison or price anchor"
    ],
    "headlines": [
      "Short Punchy Headline",
      "Benefit-Driven Headline",
      "Price/Value Headline"
    ],
    "descriptions": [
      "Supporting description with key differentiator"
    ],
    "link_url": "https://yoursite.com/landing-page",
    "url_parameters": "utm_source=meta&utm_medium=paid-social&utm_campaign=campaign-name&utm_content={{ad.name}}",
    "call_to_action_type": "SHOP_NOW"
  }
}
Config notes:
  • daily_budget
    is in cents (5000 = $50.00/day)
  • genders
    : 0 = all, 1 = male, 2 = female
  • {{ad.name}}
    is a Meta dynamic parameter — auto-fills with the ad name
  • call_to_action_type
    options:
    SHOP_NOW
    ,
    LEARN_MORE
    ,
    SIGN_UP
    ,
    GET_OFFER
    ,
    ORDER_NOW
    ,
    SUBSCRIBE
    ,
    BOOK_NOW

适用于任何DTC品牌的通用模板:
json
{
  "campaign": {
    "name": "campaign-name-month-year",
    "objective": "OUTCOME_SALES"
  },
  "adsets": [
    {
      "name": "Broad-25-54-US",
      "daily_budget": 5000,
      "targeting": {
        "age_min": 25,
        "age_max": 54,
        "genders": [0],
        "geo_locations": {"countries": ["US"]},
        "publisher_platforms": ["facebook", "instagram"],
        "facebook_positions": ["feed", "video_feeds", "story", "reels"],
        "instagram_positions": ["stream", "story", "reels", "explore"]
      },
      "optimization_goal": "OFFSITE_CONVERSIONS",
      "bid_strategy": "LOWEST_COST_WITHOUT_CAP"
    }
  ],
  "creative": {
    "images_directory": "./path/to/ad-images/",
    "primary_texts": [
      "Primary text variant 1 — lead with the hook or pain point",
      "Primary text variant 2 — lead with the benefit or social proof",
      "Primary text variant 3 — lead with a comparison or price anchor"
    ],
    "headlines": [
      "Short Punchy Headline",
      "Benefit-Driven Headline",
      "Price/Value Headline"
    ],
    "descriptions": [
      "Supporting description with key differentiator"
    ],
    "link_url": "https://yoursite.com/landing-page",
    "url_parameters": "utm_source=meta&utm_medium=paid-social&utm_campaign=campaign-name&utm_content={{ad.name}}",
    "call_to_action_type": "SHOP_NOW"
  }
}
配置说明:
  • daily_budget
    单位为美分(5000 = 每日50美元)
  • genders
    : 0 = 全部性别, 1 = 男性, 2 = 女性
  • {{ad.name}}
    是Meta动态参数 — 会自动填充为广告名称
  • call_to_action_type
    可选值:
    SHOP_NOW
    ,
    LEARN_MORE
    ,
    SIGN_UP
    ,
    GET_OFFER
    ,
    ORDER_NOW
    ,
    SUBSCRIBE
    ,
    BOOK_NOW

DTC Benchmark Reference

DTC行业基准参考

MetricGoodOKNeeds WorkWhat It Means
CTR>1.5%1-1.5%<1%% of impressions that click. Low = creative isn't resonating
CPM<$15$15-25>$25Cost per 1000 impressions. High = competitive auction or narrow audience
CPC<$1$1-2>$2Cost per click. High = low CTR driving up costs
CPA<$30$30-50>$50Cost per purchase. The ultimate efficiency metric
ROAS>3x2-3x<2xRevenue per $1 spent. Below 2x usually means losing money after COGS
Frequency1-33-5>5Avg times each person saw the ad. High = ad fatigue
Hook Rate>25%15-25%<15%% who watch first 3 sec of video. Low = weak opening
Hold Rate>10%5-10%<5%% who watch 15+ sec. Low = content doesn't sustain interest

指标优秀良好需要优化指标含义
CTR>1.5%1-1.5%<1%点击量占曝光量的百分比。数值低表示创意未吸引用户
CPM<$15$15-25>$25每千次曝光成本。数值高表示竞争激烈或受众范围过窄
CPC<$1$1-2>$2单次点击成本。数值高通常由低CTR导致
CPA<$30$30-50>$50单次购买成本。核心效率指标
ROAS>3x2-3x<2x每投入1美元带来的收入。低于2x通常意味着扣除COGS后亏损
Frequency1-33-5>5每个用户平均看到广告的次数。数值高表示广告疲劳
Hook Rate>25%15-25%<15%观看视频前3秒的用户占比。数值低表示开头缺乏吸引力
Hold Rate>10%5-10%<5%观看视频15秒以上的用户占比。数值低表示内容无法维持用户兴趣

Optimization Playbook

优化指南

Scaling winners:
  • Increase budget by 20-30% every 2-3 days (not all at once — resets learning)
  • Duplicate winning ad sets with new audiences
  • Create lookalike audiences from purchasers
Fixing underperformers:
  • CTR < 1%: Test new hooks/images — the creative isn't stopping thumbs
  • CTR > 2% but no purchases: Landing page problem, not ad problem
  • CPA too high: Narrow targeting or test lower-funnel audiences
  • Frequency > 4: Rotate in fresh creative
  • No spend after 48 hours: Switch optimization to Link Clicks temporarily, then back to Conversions
Meta learning phase:
  • Each ad set needs ~50 conversions in 7 days to exit learning
  • Don't edit during learning (resets the clock)
  • If budget is too low for 50 conversions/week, optimize for a higher-funnel event (ATC instead of Purchase)

放大优质广告:
  • 每2-3天将预算增加20-30%(不要一次性大幅增加,会重置学习期)
  • 复制优质广告组并搭配新受众
  • 基于购买用户创建相似受众
优化表现不佳的广告:
  • CTR < 1%:测试新的钩子/图片 — 创意未能吸引用户注意
  • CTR > 2%但无转化:问题出在落地页,而非广告本身
  • CPA过高:缩小受众范围或测试漏斗下层受众
  • Frequency > 4:更换新创意
  • 48小时无消耗:暂时将优化目标切换为Link Clicks,之后再换回Conversions
Meta学习期:
  • 每个广告组需要在7天内获得约50次转化才能退出学习期
  • 学习期内不要修改广告组(会重置学习进度)
  • 如果预算不足以每周获得50次转化,优化更高漏斗层级的事件(比如加入购物车而非购买)

Examples

示例

Example 1: First-time Setup
User: "I want to set up Meta ads for my store"
Skill Response:
  1. Routes to Setup.md workflow
  2. Checks if .env exists, if Business Manager is set up
  3. Walks through Developer App creation
  4. Helps generate and exchange token
  5. Configures .env
  6. Verifies with --check
Example 2: Publish a Campaign
User: "Create a campaign for our new product launch"
Skill Response:
  1. Routes to PublishCampaign.md workflow
  2. Checks credentials (routes to Setup if missing)
  3. Asks about images, copy, targeting, budget
  4. Builds config JSON
  5. Publishes (all PAUSED)
  6. Reports campaign ID and review checklist
Example 3: Check Performance
User: "How are my Meta ads doing?"
Skill Response:
  1. Routes to AnalyzePerformance.md workflow
  2. Runs --summary for account overview
  3. Compares against DTC benchmarks
  4. Identifies winners and losers
  5. Provides specific optimization recommendations
Example 4: Token Expired
User: "My meta ads token isn't working" / agent sees error code 190
Skill Response:
  1. Routes to Setup.md Part 6 (Token Refresh)
  2. Checks for FACEBOOK_APP_ID and FACEBOOK_APP_SECRET in .env
  3. Tells user to generate new short-lived token in Graph API Explorer
  4. Runs the exchange curl command
  5. Updates .env with new long-lived token
  6. Verifies with --check
Example 5: Manage Campaign
User: "Pause campaign 12345678"
Skill Response:
  1. Runs
    uv run ~/.claude/skills/MetaAds/tools/Publish.py --pause 12345678
  2. Confirms campaign is paused

Last Updated: 2026-02-07
示例1:首次设置
用户:"我想为我的店铺设置Meta广告"
技能响应:
  1. 路由到Setup.md工作流
  2. 检查.env文件是否存在、商务管理平台是否已设置
  3. 引导创建开发者应用
  4. 协助生成并交换令牌
  5. 配置.env文件
  6. 使用--check命令验证
示例2:发布广告活动
用户:"为我们的新产品发布创建一个广告活动"
技能响应:
  1. 路由到PublishCampaign.md工作流
  2. 检查凭证(若缺失则路由到设置流程)
  3. 询问图片、文案、受众定位、预算等信息
  4. 构建配置JSON
  5. 发布广告(所有对象默认暂停)
  6. 返回广告活动ID及审核清单
示例3:查看广告效果
用户:"我的Meta广告表现如何?"
技能响应:
  1. 路由到AnalyzePerformance.md工作流
  2. 运行--summary命令获取账户概览
  3. 与DTC行业基准对比
  4. 识别优质与劣质广告
  5. 提供具体的优化建议
示例4:令牌过期
用户:"我的meta ads令牌无法使用" / Agent检测到错误代码190
技能响应:
  1. 路由到Setup.md第6部分(令牌刷新)
  2. 检查.env文件中是否存在FACEBOOK_APP_ID和FACEBOOK_APP_SECRET
  3. 指导用户在Graph API Explorer中生成新的短期令牌
  4. 执行交换curl命令
  5. 更新.env文件中的长效令牌
  6. 使用--check命令验证
示例5:管理广告活动
用户:"暂停广告活动12345678"
技能响应:
  1. 运行
    uv run ~/.claude/skills/MetaAds/tools/Publish.py --pause 12345678
  2. 确认广告活动已暂停

最后更新: 2026-02-07