返回顶部
m

meta-ads-control元广告控制

Use this skill when the user wants to inspect, report on, create, update, pause, resume, budget, target, upload assets for, or troubleshoot Meta, Facebook, or Instagram ads via the Marketing API. It covers ad accounts, campaigns, ad sets, ads, creatives, ad images and videos, targeting search, batch reads, and Insights reports. Helpful for requests about Meta Ads Manager, ROAS or CPA reporting, launch workflows, creative rollout, audience setup, delivery issues, budget changes, or bulk ad operat

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
252
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

meta-ads-control

Meta Ads 控制

使用此技能进行 Meta 营销 API 相关工作。优先使用捆绑脚本,因为它提供结构化的 JSON 输出、空运行保护、重试机制、分页、批量支持、异步洞察任务、定向搜索和资产上传。

在涉及支出或投放之前

  1. 1. 发现范围。
bash python3 scripts/meta_ads.py accounts python3 scripts/meta_ads.py account
  1. 2. 确认目标广告账户、货币、时区和可写对象。
  2. 对于任何可能产生费用、改变投放或影响追踪的变更:
- 准备简短计划, - 运行 --dry-run, - 展示将要变更的具体对象和字段, - 等待用户明确批准, - 然后使用 --confirm 重新运行。
  1. 4. 默认将新广告系列、广告组和广告设置为 PAUSED,除非用户明确要求立即上线。
  2. 任何写入操作后,使用 get、list 或 request GET 进行写后读验证。

认证与环境

脚本读取:

  • - METAACCESSTOKEN — 实时 API 调用必需
  • METAADACCOUNTID — 可选默认账户,可带或不带 act
  • METAAPIVERSION — 默认为 v25.0
  • METAGRAPHBASE — 默认为 https://graph.facebook.com

如果缺少 METAACCESSTOKEN,先帮助用户设置,而不是猜测或伪造 API 响应。

OpenClaw 用户可通过技能配置注入这些值。参见 OpenClaw 说明

按任务快速路径

1) 审计或诊断账户

从能回答问题的最小读取开始。

bash
python3 scripts/metaads.py account --fields id,name,accountstatus,currency,timezonename,amountspent,spend_cap
python3 scripts/metaads.py list campaigns --fields id,name,objective,status,effectivestatus,dailybudget,lifetimebudget
python3 scripts/metaads.py list adsets --fields id,name,campaignid,status,effectivestatus,dailybudget,lifetimebudget,optimizationgoal,bid_strategy
python3 scripts/metaads.py list ads --fields id,name,adsetid,campaignid,status,effectivestatus,creative

当需要同时进行多个小读取时使用 batch。首先使用最小字段集。

2) 效果报告

使用 insights。从较窄的层级和日期窗口开始。对于大窗口、多字段或细分,使用 --async。

bash
python3 scripts/metaads.py insights act123 --level campaign --date-preset last_7d
python3 scripts/metaads.py insights act123 --level ad --fields adid,adname,spend,impressions,clicks,ctr,cpc,actions,actionvalues,purchaseroas --date-preset last_30d --async --fetch-all

如果用户询问转化或 ROAS,包含 actions 和 action_values。如果用户询问人口统计或展示位置细分,使用 --breakdowns。如果他们询问操作级别细分,包含 actions 并使用 --action-breakdowns。

3) 暂停、恢复或归档对象

单对象变更优先使用 set-status。

bash
python3 scripts/meta_ads.py set-status 120000000000000 PAUSED --dry-run
python3 scripts/meta_ads.py set-status 120000000000000 PAUSED --confirm

对于批量操作,创建 JSON 批处理文件并在批准后使用 batch。

4) 创建或更新广告系列结构

按顺序创建:

  1. 1. 广告系列
  2. 广告组
  3. 创意
  4. 广告

对任何嵌套参数使用 JSON 负载文件。从 assets/ 中的模板开始。

bash
python3 scripts/meta_ads.py create campaign --params-file assets/campaign-create.json --dry-run
python3 scripts/meta_ads.py create campaign --params-file work/campaign.json --confirm

python3 scripts/meta_ads.py create adset --params-file work/adset.json --dry-run
python3 scripts/meta_ads.py create adset --params-file work/adset.json --confirm

python3 scripts/meta_ads.py create adcreative --params-file work/adcreative.json --dry-run
python3 scripts/meta_ads.py create adcreative --params-file work/adcreative.json --confirm

python3 scripts/meta_ads.py create ad --params-file work/ad.json --dry-run
python3 scripts/meta_ads.py create ad --params-file work/ad.json --confirm

如果资产是本地文件,先用 upload 上传。

5) 定向发现

切勿编造定向 ID。先用定向搜索解析它们。

bash
python3 scripts/meta_ads.py targeting-search --type adinterest --q running
python3 scripts/meta_ads.py targeting-search --type adgeolocation --q Munich

然后将返回的 ID 和描述符放入广告组 targeting 规范中。

6) 不支持或小众端点

使用底层 request 子命令。

bash
python3 scripts/metaads.py request GET /act123/reachestimate --set targeting_spec=@work/targeting.json
python3 scripts/metaads.py request GET /120000000000000/previews --set adformat=DESKTOPFEEDSTANDARD

对于嵌套值,优先使用 --params-file 或 @file.json 值,而不是多个内联 --set。

脚本参考

主入口点

bash
python3 scripts/meta_ads.py --help

最常用的子命令

  • - accounts — 列出令牌可访问的广告账户
  • account — 读取默认或提供的账户
  • list — 列出广告系列、广告组、广告、创意、受众、资产、像素等
  • get — 读取节点或节点边缘
  • create — 创建广告系列、广告组、广告创意、广告、自定义受众或任何支持的账户边缘
  • update — 按 ID 更新节点
  • set-status — status 的便捷封装
  • insights — 同步或异步报告
  • targeting-search — 解析定向描述符
  • upload — 上传到 adimages 或 advideos
  • batch — 发送 Graph 批量请求
  • request — 任何 Graph 路径的底层逃生出口

良好代理行为规则

  • - 先读后写。
  • 使用能回答问题的最小字段集。
  • 嵌套数据优先使用 JSON 负载文件。
  • 仅在用户确实需要所有页面时使用 --fetch-all。
  • 对大型洞察任务使用 --async。
  • 遇到重复的 613 或 80004 速率限制错误时暂停;减少范围或增加重试间隔。
  • 优先使用 PAUSED 或 ARCHIVED,而非破坏性删除操作。
  • 在相关时以原始 API 单位和人类可读单位报告金额。预算通常以最小货币面额表示。
  • 写入预算时,先验证账户货币和时区。
  • 任何变更后,通过后续读取验证实时状态。
  • 如果请求涉及住房、就业、信贷、社会问题、选举或政治,在继续之前检查 API 指南 中的特殊类别注意事项。

示例

快速 7 天账户快照

bash
python3 scripts/meta_ads.py batch --batch-file assets/batch-read-example.json
python3 scripts/metaads.py insights act123 --level campaign --date-preset last7d --fields campaignid,campaignname,spend,impressions,clicks,ctr,cpc,actions,actionvalues,purchase_roas

安全增加预算

  1. 1. 检查当前广告组。
  2. 准备包含新预算的更新负载。
  3. 空运行。
  4. 请求确认。
  5. 应用并验证。

bash
python3 scripts/metaads.py get 120000000000000 --fields id,name,status,effectivestatus,dailybudget,lifetimebudget
python3 scripts/meta_ads.py update 120000000000000 --params-file work/adset-budget.json --dry-run
python3 scripts/meta_ads.py update 120000000000000 --params-file work/adset-budget.json --confirm
python3 scripts/metaads.py get 120000000000000 --fields id,name,dailybudget,lifetimebudget,updatedtime

上传图片并构建链接广告

bash
python3 scripts/meta_ads.py upload adimages --file creative.jpg --confirm

将返回的 image_hash 放入 work/adcreative.json


python3 scripts/meta_

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 meta-ads-control-1776093064 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 meta-ads-control-1776093064 技能

通过命令行安装

skillhub install meta-ads-control-1776093064

下载

⬇ 下载 meta-ads-control v1.0.0(免费)

文件大小: 30.14 KB | 发布时间: 2026-4-15 13:24

v1.0.0 最新 2026-4-15 13:24
meta-ads-control 1.0.0

- Initial release of the Meta Ads Control skill for managing and reporting on Meta, Facebook, and Instagram ads via the Marketing API.
- Supports inspection, reporting, creation, update, pausing, resuming, budgeting, targeting, troubleshooting, and asset uploads for ad accounts, campaigns, ad sets, creatives, and ads.
- Features dry-run protection, retries, pagination, batch operations, async Insights reporting, and targeting search.
- Requires Python 3, outbound API access, and configuration via environment variables.
- Detailed usage guidance and best practices included in SKILL.md.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部