Google Ads Skill
Manage Google Ads accounts via API or browser automation.
Mode Selection
Check which mode to use:
- 1. API Mode - If user has
google-ads.yaml configured or GOOGLE_ADS_* env vars - Browser Mode - If user says "I don't have API access" or just wants quick checks
CODEBLOCK0
If no config found, ask: "Do you have Google Ads API credentials, or should I use browser automation?"
Browser Automation Mode (Universal)
Requirements: User logged into ads.google.com in browser
Setup
- 1. User opens ads.google.com and logs in
- User clicks Clawdbot Browser Relay toolbar icon (badge ON)
- Use
browser tool with INLINECODE3
Common Workflows
Get Campaign Performance
CODEBLOCK1
Find Zero-Conversion Keywords (Wasted Spend)
CODEBLOCK2
Pause Keywords/Campaigns
CODEBLOCK3
Download Reports
CODEBLOCK4
For detailed browser selectors: See references/browser-workflows.md
API Mode (Power Users)
Requirements: Google Ads API developer token + OAuth credentials
Setup Check
CODEBLOCK5
Common Operations
Query Campaign Performance
CODEBLOCK6
Find Zero-Conversion Keywords
CODEBLOCK7
Pause Keywords
CODEBLOCK8
For full API reference: See references/api-setup.md
Audit Checklist
Quick health check for any Google Ads account:
| Check | Browser Path | What to Look For |
|---|
| Zero-conv keywords | Keywords → Filter: Conv<1, Cost>$500 | Wasted spend |
| Empty ad groups |
Ad Groups → Filter: Ads=0 | No creative running |
| Policy violations | Campaigns → Status column | Yellow warning icons |
| Optimization Score | Overview page (top right) | Below 70% = action needed |
| Conversion tracking | Tools → Conversions | Inactive/no recent data |
Output Formats
When reporting findings, use tables:
CODEBLOCK9
Troubleshooting
Browser Mode Issues
- - Can't see data: Check user is on correct account (top right account selector)
- Slow loading: Google Ads UI is heavy; wait for tables to fully load
- Session expired: User needs to re-login to ads.google.com
API Mode Issues
- - Authentication failed: Refresh OAuth token, check INLINECODE6
- Developer token rejected: Ensure token is approved (not test mode)
- Customer ID error: Use 10-digit ID without dashes
Google Ads 技能
通过API或浏览器自动化管理Google Ads账户。
模式选择
检查使用哪种模式:
- 1. API模式 - 如果用户已配置google-ads.yaml或设置了GOOGLEADS*环境变量
- 浏览器模式 - 如果用户表示我没有API访问权限或只想快速检查
bash
检查API配置
ls ~/.google-ads.yaml 2>/dev/null || ls google-ads.yaml 2>/dev/null
如果未找到配置,询问:您有Google Ads API凭据,还是我应该使用浏览器自动化?
浏览器自动化模式(通用)
要求: 用户在浏览器中登录ads.google.com
设置
- 1. 用户打开ads.google.com并登录
- 用户点击Clawdbot浏览器中继工具栏图标(徽章开启)
- 使用browser工具,参数profile=chrome
常见工作流程
获取广告系列效果
- 1. 导航至:ads.google.com/aw/campaigns
- 设置日期范围(右上角日期选择器)
- 截图广告系列表格
- 解析:广告系列、状态、预算、费用、转化次数、每次转化费用
查找零转化关键词(浪费的支出)
- 1. 导航至:ads.google.com/aw/keywords
- 点击添加筛选条件 → 转化次数 → 小于 → 1
- 点击添加筛选条件 → 费用 → 大于 → [阈值,例如$500]
- 按费用降序排序
- 截图表格进行分析
暂停关键词/广告系列
- 1. 导航至关键词或广告系列视图
- 勾选要暂停的项目
- 点击编辑下拉菜单 → 暂停
- 确认操作
下载报告
- 1. 导航至所需视图(广告系列、关键词等)
- 点击下载图标(表格右上角)
- 选择格式(推荐CSV)
- 文件下载到用户的下载文件夹
详细的浏览器选择器: 请参阅references/browser-workflows.md
API模式(高级用户)
要求: Google Ads API开发者令牌 + OAuth凭据
设置检查
bash
验证google-ads SDK
python -c from google.ads.googleads.client import GoogleAdsClient; print(OK)
检查配置
cat ~/.google-ads.yaml
常见操作
查询广告系列效果
python
from google.ads.googleads.client import GoogleAdsClient
client = GoogleAdsClient.loadfromstorage()
gaservice = client.getservice(GoogleAdsService)
query =
SELECT campaign.name, campaign.status,
metrics.cost_micros, metrics.conversions,
metrics.costperconversion
FROM campaign
WHERE segments.date DURING LAST30DAYS
ORDER BY metrics.cost_micros DESC
response = gaservice.search(customerid=CUSTOMER_ID, query=query)
查找零转化关键词
python
query =
SELECT ad
groupcriterion.keyword.text,
campaign.name, metrics.cost_micros
FROM keyword_view
WHERE metrics.conversions = 0
AND metrics.cost_micros > 500000000
AND segments.date DURING LAST
90DAYS
ORDER BY metrics.cost_micros DESC
暂停关键词
python
operations = []
for keyword
id in keywordsto_pause:
operation = client.get_type(AdGroupCriterionOperation)
operation.update.resource
name = fcustomers/{customerid}/adGroupCriteria/{ad
groupid}~{keyword_id}
operation.update.status = client.enums.AdGroupCriterionStatusEnum.PAUSED
operations.append(operation)
service.mutateadgroupcriteria(customerid=customer_id, operations=operations)
完整的API参考: 请参阅references/api-setup.md
审计清单
任何Google Ads账户的快速健康检查:
| 检查项 | 浏览器路径 | 需要关注的内容 |
|---|
| 零转化关键词 | 关键词 → 筛选条件:转化<1,费用>$500 | 浪费的支出 |
| 空广告组 |
广告组 → 筛选条件:广告=0 | 没有正在投放的创意 |
| 政策违规 | 广告系列 → 状态列 | 黄色警告图标 |
| 优化得分 | 概览页面(右上角) | 低于70% = 需要采取措施 |
| 转化跟踪 | 工具 → 转化 | 未激活/无近期数据 |
输出格式
报告发现时,使用表格:
markdown
广告系列效果(最近30天)
| 广告系列 | 费用 | 转化次数 | 每次转化费用 | 状态 |
|---|
| 品牌 | $5K | 50 | $100 | ✅ 良好 |
| SDK Web |
$10K | 2 | $5K | ❌ 暂停 |
建议操作
- 1. 暂停:SDK Web广告系列($5K每次转化费用)
- 增加预算:品牌广告系列(表现强劲)
故障排除
浏览器模式问题
- - 无法看到数据:检查用户是否在正确的账户上(右上角账户选择器)
- 加载缓慢:Google Ads UI较重;等待表格完全加载
- 会话过期:用户需要重新登录ads.google.com
API模式问题
- - 身份验证失败:刷新OAuth令牌,检查google-ads.yaml
- 开发者令牌被拒绝:确保令牌已获批(非测试模式)
- 客户ID错误:使用10位数字ID,不带连字符