google-ads
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Ads
Google Ads
<!-- BEGIN:skill-intro -->
Tools for working with a Google Ads account against the Google Ads API (). Reads are expressed in GAQL (Google Ads Query Language) against the search endpoint; writes go through the per-resource mutate endpoints. 13 tools across account navigation, reads and reporting, and campaign / budget / conversion-tracking management. Google Ads organizes accounts as a hierarchy: a manager (MCC) account can operate client accounts beneath it. Most tools take the operating account's , plus an optional (the manager account) when the operating account is reached through a manager.
<!-- legal:disclaimer -->
https://googleads.googleapis.com/v23/customerIdloginCustomerIdIndependent, unofficial connector for Google Ads. Not affiliated with, endorsed by, or sponsored by Google Ads. "Google Ads" is a trademark of its owner, used only to identify the service this connector works with.
<!-- /legal:disclaimer -->
<!-- END:skill-intro --><!-- BEGIN:skill-intro -->
用于通过Google Ads API()操作Google Ads账户的工具。读取操作通过搜索端点以GAQL(Google Ads查询语言)实现;写入操作通过各资源对应的mutate端点完成。涵盖账户导航、读取与报表、广告系列/预算/转化跟踪管理三大类,共13个工具。Google Ads采用层级化账户结构:管理型(MCC)账户可操作其下的客户账户。大多数工具需要传入操作账户的,若通过管理型账户访问操作账户,还可传入可选的(即管理型账户ID)。
<!-- legal:disclaimer -->
https://googleads.googleapis.com/v23/customerIdloginCustomerId独立、非官方的Google Ads连接器。与Google Ads无关联、未获其认可或赞助。"Google Ads"为其所有者的商标,仅用于标识本连接器所适配的服务。
<!-- /legal:disclaimer -->
<!-- END:skill-intro -->When to use this
适用场景
<!-- BEGIN:skill-use-cases -->
- Resolve which account to act on — list the accounts the connection can access, then (when access is through a manager) the client accounts beneath it.
- Read campaigns, ad groups, and ads — list them with status and budget, or run an arbitrary GAQL query for anything the structured reads don't cover.
- Build performance reports — pick a resource, the metrics to measure, and a date range.
- Manage campaigns and budgets — pause, enable, or remove a campaign; create or adjust a daily budget.
- Set up conversion tracking — list or create conversion actions (including the offline-conversion action).
UPLOAD_CLICKS
<!-- BEGIN:skill-use-cases -->
- 确定操作的账户——列出连接可访问的账户,若通过管理型账户访问,还可列出其下的客户账户。
- 读取广告系列、广告组和广告——列出包含状态与预算的相关信息,或运行任意GAQL查询以覆盖结构化读取未涵盖的内容。
- 构建绩效报表——选择资源、要衡量的指标以及日期范围。
- 管理广告系列与预算——暂停、启用或删除广告系列;创建或调整每日预算。
- 设置转化跟踪——列出或创建转化操作(包括线下转化的操作)。
UPLOAD_CLICKS
Setup
安装配置
This is an agentskills.io skill.
If the connector has not been installed as a skill yet, install it first with (or your harness's own skill-install mechanism), then continue here. Installing the skill copies these files, not dependencies. Before running the CLI, a local MCP server, or auth commands, run here once. Importing the published package as a dependency in your own project instead? That already resolves everything — see .
npx skills add zapier/connectors --skill google-adszapier-sdknpm install --omit=devnpm installreferences/use-as-sdk.mdThe connector runs on Node.js 22.18+. Pick the reference that matches how you're running it, and load it before doing anything else:
| You have... | Load |
|---|---|
An MCP-aware client — tools may already be loaded (e.g. | |
Terminal / subprocess access (you can run | |
| Only your own code, importing this package as a dependency | |
| No tool access, no terminal, no ability to import this package — you write your own code that calls the Google Ads API directly (e.g. a code-execution sandbox) | |
这是一个agentskills.io技能。
如果尚未将该连接器作为技能安装,请先执行(或使用你的Harness自带的技能安装机制)进行安装,然后继续以下步骤。安装技能仅会复制这些文件,不会安装依赖项。运行CLI、本地MCP服务器或认证命令前,请在此处执行一次。若要在你自己的项目中导入已发布的包作为依赖?此时已解决所有依赖问题——请参阅。
npx skills add zapier/connectors --skill google-adszapier-sdknpm install --omit=devnpm installreferences/use-as-sdk.md该连接器运行于**Node.js 22.18+**环境。请选择与你的运行方式匹配的参考文档,并在操作前加载它:
| 你拥有... | 加载方式 |
|---|---|
支持MCP的客户端——工具可能已加载(例如 | |
终端/子进程访问权限(可运行 | |
| 仅能使用自有代码,将本包作为依赖导入 | |
| 无工具访问权限、无终端、无法导入本包——需自行编写调用Google Ads API的代码(例如在代码执行沙箱中) | |
Scripts
脚本说明
<!-- BEGIN:skill-connections-note? -->
All scripts use the single connection . Customer-scoped scripts take the operating account's (digits only) and an optional (the manager account, when access is through a manager).
<!-- END:skill-connections-note -->
<!-- BEGIN:skill-scripts-table -->
google-adscustomerIdloginCustomerId| Script | Script name | Connections | Description |
|---|---|---|---|
| | | List the accounts the connection can directly access (the account-resolution entry point). |
| | | List the client (operating) accounts beneath a manager account. |
| | | Run an arbitrary GAQL query — the full read surface. |
| | | List the selectable / filterable / sortable fields for a resource (compose a |
| | | List campaigns with status, channel type, budget, and dates. |
| | | List ad groups, optionally scoped to one campaign. |
| | | List ads, optionally scoped to one ad group. |
| | | List the conversion actions configured on the account. |
| | | Build a performance report: resource + metrics + segments over a date range. |
| | | Pause, enable, or remove a campaign. |
| | | Create a daily campaign budget (amount in micros). |
| | | Update an existing budget's amount, name, or delivery method. |
| | | Create a conversion action (e.g. |
Learn a script's input contract before calling it — never guess field names, casing, or types. Run on a script ( or ); it renders the as JSON Schema and lists the connection flag and resolvers. Guessing the payload just produces a and wastes a round-trip.
<!-- END:skill-scripts-table -->
<!-- BEGIN:disambiguation-and-refusals? -->--help./scripts/<name>.ts --helpnode cli.js run <name> --helpinputSchemaZodError<!-- BEGIN:skill-connections-note? -->
所有脚本均使用单个连接。客户范围的脚本需要传入操作账户的(仅数字),以及可选的(当通过管理型账户访问时,即管理型账户ID)。
<!-- END:skill-connections-note -->
<!-- BEGIN:skill-scripts-table -->
google-adscustomerIdloginCustomerId| 脚本 | 脚本名称 | 连接 | 描述 |
|---|---|---|---|
| | | 列出连接可直接访问的账户(账户解析的入口)。 |
| | | 列出管理型账户下的客户(操作)账户。 |
| | | 运行任意GAQL查询——完整的读取功能。 |
| | | 列出资源的可选/可过滤/可排序字段(用于编写 |
| | | 列出包含状态、渠道类型、预算和日期的广告系列。 |
| | | 列出广告组,可选择限定单个广告系列。 |
| | | 列出广告,可选择限定单个广告组。 |
| | | 列出账户中配置的转化操作。 |
| | | 构建绩效报表:资源 + 指标 + 日期范围内的细分维度。 |
| | | 暂停、启用或删除广告系列。 |
| | | 创建每日广告预算(金额以微单位表示)。 |
| | | 更新现有预算的金额、名称或投放方式。 |
| | | 创建转化操作(例如用于线下跟踪的 |
调用脚本前请先了解其输入规则——切勿猜测字段名称、大小写或类型。 对脚本执行命令(或);它会将渲染为JSON Schema,并列出连接标志和解析器。猜测参数只会产生,浪费一次请求。
<!-- END:skill-scripts-table -->
<!-- BEGIN:disambiguation-and-refusals? -->--help./scripts/<name>.ts --helpnode cli.js run <name> --helpinputSchemaZodErrorDisambiguation & refusals
歧义处理与拒绝规则
- Money is in micros. Budgets, bids, and report cost metrics () are 1,000,000 × the currency amount (e.g. $50.00 →
*_micros). The one exception is a conversion action's default value, which is plain currency. Don't report a50000000of 5,000,000 as "$5,000,000".cost_micros - Act on ids, not names. Writes (,
setCampaignStatus) take ids. Resolve a name to an id first withupdateCampaignBudget/listCampaigns; if two campaigns share a name, list them with a distinguishing field (id, status, channel type) and confirm which one before acting — never silently pick.search - Unsupported — decline, don't substitute. This connector does not upload offline conversions or add members to a Customer Match audience (Google routes new API integrations to the separate Data Manager API for those), and does not create full campaigns or manage keywords / targeting / ad creatives. If asked, say it's unsupported rather than substituting another tool and reporting success. sets up the conversion action; it does not upload conversions.
createConversionAction
- 金额以微单位表示。预算、出价和报表成本指标()为货币金额的1,000,000倍(例如:$50.00 →
*_micros)。唯一例外是转化操作的默认值,它以普通货币单位表示。请勿将50000000值5,000,000报告为"$5,000,000"。cost_micros - 依据ID而非名称操作。写入操作(、
setCampaignStatus)需要传入ID。请先通过updateCampaignBudget/listCampaigns将名称解析为ID;如果两个广告系列名称相同,请列出包含区分字段(ID、状态、渠道类型)的信息,并在操作前确认具体是哪一个——切勿静默选择。search - 不支持的操作——直接拒绝,不要替代。本连接器不支持上传线下转化或向客户匹配受众添加成员(Google已将这些新API集成路由至单独的数据管理器API),也不支持创建完整的广告系列或管理关键词/定向/广告创意。如果用户提出此类请求,请告知不支持,而非使用其他工具替代并报告操作成功。仅用于设置转化操作,不负责上传转化数据。
createConversionAction
Auth
认证方式
Every shape passes auth as one connection selector, not the secret — a string. Every connector accepts (Zapier-managed auth — routes through Zapier's auth, retries, and governance layer); some also accept one or more direct-token resolvers (naming and count vary per connector) — check this connector's own resolvers rather than assuming. The prefix is optional; a bare value goes to the first resolver that claims it — a UUID-shaped bare value always claims . Each script declares the connections it needs and the resolvers each accepts. The exact syntax for passing a connection (and how to see this connector's resolver list) differs by shape — see the reference you loaded above.
[<resolver>:]<value>zapier:<connection-id><resolver>:zapier:Checking what's already configured first? Don't dump environment values to do it — or prints the value along with the name, leaking a live credential into the transcript if one is set. Check names only () or test a known name directly ().
<!-- BEGIN:skill-auth-notes? operational behavior that differs by WHICH resolver is used — a safety gate only one path enforces, scopes/permissions that differ between resolvers, a billing/plan difference tied to the auth path, or a feature only available (or unavailable) on one resolver. Not for describing how to obtain or pass a credential — that's references/use-without-zapier.md's job. Leave this region empty (unfilled) if every resolver behaves identically. -->
<!-- END:skill-auth-notes -->
envenv | grep <name>env | cut -d= -f1 | grep -i <name>[ -n "$VAR_NAME" ]No connection yet? Pick one — and follow the reference's own flow to obtain it; never just ask the user for a connection id or token as if they already have one memorized:
| Load | |
|---|---|
| Pass the credential directly | |
| Route it through a Zapier connection | |
所有操作均通过单个连接选择器传递认证信息,而非密钥——格式为的字符串。每个连接器均接受(Zapier托管的认证——通过Zapier的认证、重试和治理层路由);部分连接器还接受一种或多种直接令牌解析器(名称和数量因连接器而异)——请查看本连接器自身的解析器列表,不要假设。前缀是可选的;无前缀的值会被第一个匹配的解析器处理——UUID格式的无前缀值始终匹配。每个脚本都会声明其所需的连接以及接受的解析器。传递连接的确切语法(以及查看本连接器解析器列表的方式)因运行环境而异——请参阅你之前加载的参考文档。
[<resolver>:]<value>zapier:<connection-id><resolver>:zapier:想要先查看已配置的内容?不要通过打印环境变量来实现——或会同时打印名称和值,如果设置了有效凭证,会将其泄露到日志中。请仅查看名称()或直接测试已知名称()。
<!-- BEGIN:skill-auth-notes? operational behavior that differs by WHICH resolver is used — a safety gate only one path enforces, scopes/permissions that differ between resolvers, a billing/plan difference tied to the auth path, or a feature only available (or unavailable) on one resolver. Not for describing how to obtain or pass a credential — that's references/use-without-zapier.md's job. Leave this region empty (unfilled) if every resolver behaves identically. -->
<!-- END:skill-auth-notes -->
envenv | grep <name>env | cut -d= -f1 | grep -i <name>[ -n "$VAR_NAME" ]还未配置连接?请选择以下方式之一,并按照对应参考文档的流程获取连接——切勿直接向用户索要连接ID或令牌,默认他们不会记住这些信息:
| 加载方式 | |
|---|---|
| 直接传递凭证 | |
| 通过Zapier连接路由 | |
Output format
输出格式
Every script returns a envelope:
{ data, meta }- — the script's result (the shape its
datadeclares; see the reference you loaded above for how to inspect a script's exact schema in your shape).outputSchema - — what validating
meta.outputDataValidationdid:data- — validated, nothing removed.
{ skipped: false, droppedPaths: null } - — validated, but those paths were stripped from
{ skipped: false, droppedPaths: [...], instruction }: fields the script returned from the API that thedatadoesn't declare. If you need them, re-run with output validation skipped.outputSchema - — validation was bypassed;
{ skipped: true }is the raw, unchecked script output.data
Reading dropped fields / . To receive the raw, unvalidated result, opt out of output validation (the exact syntax differs by shape — see the reference you loaded above). Input validation is never skipped.
skipOutputDataValidationTrimming the result / . To shrink a large result down to the fields you need, pass a jq expression that post-processes (again, exact syntax per shape). The jq runs against only, NOT the envelope, so write it rooted at (run the script's — or your shape's equivalent — to see its output schema). The transformed value replaces , is preserved, and the result is NOT re-validated against the output schema.
<!-- BEGIN:skill-references-table -->filterOutputDatadatadata{ data, meta }data--helpdatameta每个脚本都会返回一个结构:
{ data, meta }- ——脚本的结果(其
data声明的结构;请参阅你加载的参考文档,了解如何在你的环境中查看脚本的确切模式)。outputSchema - ——对
meta.outputDataValidation的验证结果:data- ——已验证,未移除任何内容。
{ skipped: false, droppedPaths: null } - ——已验证,但这些路径已从
{ skipped: false, droppedPaths: [...], instruction }中移除:脚本从API返回的字段未在data中声明。如果需要这些字段,请在跳过输出验证的情况下重新运行。outputSchema - ——已绕过验证;
{ skipped: true }为原始的、未经过检查的脚本输出。data
读取被移除的字段 / 。若要接收原始的未验证结果,请选择退出输出验证(确切语法因环境而异——请参阅你加载的参考文档)。输入验证永远不会被跳过。
skipOutputDataValidation精简结果 / 。若要将大型结果精简为你需要的字段,请传入一个jq表达式对进行后处理(同样,确切语法因环境而异)。jq仅针对运行,而非结构,因此请以为根编写表达式(运行脚本的——或你的环境中的等效命令——查看其输出模式)。转换后的值将替换,会被保留,且结果不会再次根据输出模式进行验证。
<!-- BEGIN:skill-references-table -->filterOutputDatadatadata{ data, meta }data--helpdatametaReferences
参考文档
Load the matching reference file before working in that area:
| Reference | Covers | Load it when |
|---|---|---|
| references/google-ads-api-gotchas.md | Auth headers, account hierarchy, GAQL, micros, mutate semantics, errors, rate limits, conversion tracking, versioning. | Before composing a GAQL query, working with money fields (micros), setting campaign status, or interpreting a Google Ads API error. |
在对应领域工作前,请加载匹配的参考文档:
| 参考文档 | 涵盖内容 | 加载时机 |
|---|---|---|
| references/google-ads-api-gotchas.md | 认证头、账户层级、GAQL、微单位、mutate语义、错误、速率限制、转化跟踪、版本控制。 | 在编写GAQL查询、处理金额字段(微单位)、设置广告系列状态或解读Google Ads API错误前。 |