google-ads-api-account-diagnostics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Ads API Account Performance Diagnostics Skill
Google Ads API 账户性能诊断Skill
This skill provides instructions on how to use the Google Ads MCP server tools to diagnose common account performance issues.
本Skill提供了如何使用Google Ads MCP服务器工具诊断常见账户性能问题的说明。
Workflows
工作流程
Identifying Active Client Accounts
识别活跃客户账户
Most diagnostics tasks require sending GAQL queries to a specific customer account. If the customer ID is not explicitly provided by the user, you must first call the (or ) tool to retrieve the customer resource names/IDs you have access to.
list_accessible_customerscustomers_list_accessible_customersOnce you have the list of accessible customer IDs, query the resource using the tool under those customer accounts to find active client customer accounts. Make sure to select only enabled client accounts and filter out manager accounts:
customer_clientsearchsql
SELECT
customer_client.id,
customer_client.descriptive_name,
customer_client.status,
customer_client.manager
FROM customer_client
WHERE customer_client.status = 'ENABLED' AND customer_client.manager = FALSEOnly run subsequent diagnostic queries against the enabled client customer IDs retrieved from this list. Do not query deactivated or manager accounts, as doing so will cause API errors.
大多数诊断任务需要向特定客户账户发送GAQL查询。如果用户未明确提供客户ID,您必须先调用(或)工具来获取您有权访问的客户资源名称/ID。
list_accessible_customerscustomers_list_accessible_customers获取可访问的客户ID列表后,在这些客户账户下使用工具查询资源,以找到活跃的客户账户。确保仅选择已启用的客户账户,并过滤掉管理账户:
searchcustomer_clientsql
SELECT
customer_client.id,
customer_client.descriptive_name,
customer_client.status,
customer_client.manager
FROM customer_client
WHERE customer_client.status = 'ENABLED' AND customer_client.manager = FALSE后续的诊断查询仅针对从此列表中获取的已启用客户账户ID执行。请勿查询已停用或管理账户,否则会导致API错误。
Using the MCP Tools Directly
直接使用MCP工具
To retrieve information and run queries, you must call the tool on the MCP server directly (with arguments like , , , and ). Do not write or execute custom Python scripts or use the Google Ads client library to query the API, as they will fail authentication inside the evaluation sandbox.
searchcustomer_idfieldsresourceconditions要检索信息并运行查询,您必须直接在MCP服务器上调用工具(参数包括、、和)。请勿编写或执行自定义Python脚本,也不要使用Google Ads客户端库查询API,因为它们在评估沙箱中会验证失败。
searchcustomer_idfieldsresourceconditions1. Conversion and Conversion Value Loss
1. 转化与转化价值损失
When conversions or conversion value suddenly decline, use the following steps to diagnose the issue.
Steps:
-
Discover Fields: Usewith resource
get_resource_metadataorcampaignto ensure you have the correct field names.ad_group -
Query Performance: Useto retrieve performance data.
search- Resource: or
campaignad_group - Fields: Include ,
campaign.name,metrics.conversions,metrics.conversions_value.metrics.cost_micros - Segments: To isolate the loss, include segments like ,
segments.date,segments.device.segments.conversion_action - Conditions: Compare the period of decline with a previous period (e.g., ).
segments.date >= '{start_date}' - Gotcha: must be divided by 1,000,000 to get standard currency amounts.
metrics.cost_micros
Example GAQL Query: To query performance data for a customer accountbetween{customer_id}and{start_date}:{end_date}sqlSELECT campaign.name, metrics.conversions, metrics.conversions_value, metrics.cost_micros, segments.date, segments.device, segments.conversion_action FROM campaign WHERE segments.date >= '{start_date}' AND segments.date <= '{end_date}' - Resource:
-
Analyze: Check if the loss is limited to certain devices (e.g., mobile vs desktop) or specific conversion actions.
-
Check Uploads: If using offline imports, queryto verify upload pipeline health. If the query returns no results, report that no offline uploads exist for the account and proceed.
offline_conversion_upload_conversion_action_summaryExample GAQL Query: To check upload pipeline health for a customer account:{customer_id}sqlSELECT offline_conversion_upload_conversion_action_summary.conversion_action_name, offline_conversion_upload_conversion_action_summary.successful_event_count, offline_conversion_upload_conversion_action_summary.total_event_count, offline_conversion_upload_conversion_action_summary.status FROM offline_conversion_upload_conversion_action_summary
当转化量或转化价值突然下降时,使用以下步骤诊断问题。
步骤:
-
发现字段:使用并指定资源
get_resource_metadata或campaign,确保您使用正确的字段名称。ad_group -
查询性能数据:使用检索性能数据。
search- 资源:或
campaignad_group - 字段:包含、
campaign.name、metrics.conversions、metrics.conversions_value。metrics.cost_micros - 细分维度:为了定位损失来源,可包含、
segments.date、segments.device等细分维度。segments.conversion_action - 条件:将下降期间与之前的时间段进行比较(例如)。
segments.date >= '{start_date}' - 注意事项:必须除以1,000,000才能得到标准货币金额。
metrics.cost_micros
GAQL查询示例: 查询客户账户在{customer_id}至{start_date}期间的性能数据:{end_date}sqlSELECT campaign.name, metrics.conversions, metrics.conversions_value, metrics.cost_micros, segments.date, segments.device, segments.conversion_action FROM campaign WHERE segments.date >= '{start_date}' AND segments.date <= '{end_date}' - 资源:
-
分析:检查损失是否局限于特定设备(如移动设备vs桌面设备)或特定转化操作。
-
检查上传情况:如果使用离线导入,查询以验证上传管道的健康状况。如果查询无结果,说明该账户不存在离线上传,直接向用户报告并继续后续操作。
offline_conversion_upload_conversion_action_summaryGAQL查询示例: 检查客户账户的上传管道健康状况:{customer_id}sqlSELECT offline_conversion_upload_conversion_action_summary.conversion_action_name, offline_conversion_upload_conversion_action_summary.successful_event_count, offline_conversion_upload_conversion_action_summary.total_event_count, offline_conversion_upload_conversion_action_summary.status FROM offline_conversion_upload_conversion_action_summary
2. Opportunities Lost (Impression Share)
2. 机会流失(展示份额)
To identify lost opportunities due to ad rank, bids, or budgets, analyze impression share metrics.
Steps:
-
Query Impression Share: Useto retrieve impression share metrics.
search- Resource:
campaign - Fields: Include ,
campaign.name,metrics.search_impression_share,metrics.search_rank_lost_impression_share.metrics.search_budget_lost_impression_share - Gotcha: Impression share values in the API are returned as decimals (e.g., 0.35 = 35%) or formatted strings (e.g., ).
"< 0.10"
Example GAQL Query: To query impression share metrics for a customer accountbetween{customer_id}and{start_date}:{end_date}sqlSELECT campaign.name, metrics.search_impression_share, metrics.search_rank_lost_impression_share, metrics.search_budget_lost_impression_share FROM campaign WHERE segments.date >= '{start_date}' AND segments.date <= '{end_date}' - Resource:
-
Analyze:
- High indicates opportunities lost due to limited budget.
search_budget_lost_impression_share - High indicates opportunities lost due to low ad rank (bid or quality issues).
search_rank_lost_impression_share
- High
要识别因广告排名、出价或预算导致的机会流失,需分析展示份额指标。
步骤:
-
查询展示份额:使用检索展示份额指标。
search- 资源:
campaign - 字段:包含、
campaign.name、metrics.search_impression_share、metrics.search_rank_lost_impression_share。metrics.search_budget_lost_impression_share - 注意事项:API返回的展示份额值为小数(例如0.35 = 35%)或格式化字符串(例如)。
"< 0.10"
GAQL查询示例: 查询客户账户在{customer_id}至{start_date}期间的展示份额指标:{end_date}sqlSELECT campaign.name, metrics.search_impression_share, metrics.search_rank_lost_impression_share, metrics.search_budget_lost_impression_share FROM campaign WHERE segments.date >= '{start_date}' AND segments.date <= '{end_date}' - 资源:
-
分析:
- 较高的表示因预算有限导致机会流失。
search_budget_lost_impression_share - 较高的表示因广告排名低(出价或质量问题)导致机会流失。
search_rank_lost_impression_share
- 较高的
3. Low Lead Flow Diagnostics
3. 潜在客户流量低的诊断
When a user asks "why is my lead flow low these past few days?", follow this systematic approach.
Steps:
-
Confirm Drop: Query conversions segmented by date for the last few days vs the previous period.
-
Isolate Cause:
- Check if Traffic (clicks, impressions) dropped.
- Check if Conversion Rate (conversions/clicks) dropped.
-
If Traffic Dropped: Check Impression Share metrics (see Workflow 2) to see if it's a budget or rank issue, or if search volume generally declined.
-
If Conversion Rate Dropped: Check breakdowns byor
segments.deviceto see if a specific area is failing.segments.conversion_action -
Check Changes: Query theresource to see if any changes were made to bids, budgets, or targeting around the time the drop started.
change_event- Gotcha (change_event constraints): Queries to the resource:
change_event- Must specify a clause of less than or equal to 10000.
LIMIT - Must filter by date () within the past 30 days.
change_event.change_date_time - Cannot select performance metrics (e.g., is not supported; only
metrics.*attributes and allowed resource fields can be selected).change_event
- Must specify a
Example GAQL Query: To query change events for a customer accountbetween{customer_id}and{start_date}:{end_date}sqlSELECT change_event.change_date_time, change_event.change_resource_name, change_event.resource_change_operation, change_event.changed_fields FROM change_event WHERE change_event.change_date_time >= '{start_date}' AND change_event.change_date_time <= '{end_date}' LIMIT 10000 - Gotcha (change_event constraints): Queries to the
当用户询问“为什么最近几天我的潜在客户流量很低?”时,请遵循以下系统化方法。
步骤:
-
确认下降情况:按日期细分查询最近几天与之前时间段的转化数据。
-
定位原因:
- 检查流量(点击量、展示量)是否下降。
- 检查转化率(转化量/点击量)是否下降。
-
如果流量下降:检查展示份额指标(参见工作流程2),判断是预算、排名问题,还是整体搜索量下降。
-
如果转化率下降:按或
segments.device细分数据,查看是否是特定领域出现问题。segments.conversion_action -
检查变更记录:查询资源,查看下降开始前后是否有出价、预算或定向设置的变更。
change_event- 注意事项(change_event约束):查询资源时:
change_event- 必须指定子句,且值小于或等于10000。
LIMIT - 必须按日期过滤(),且日期在过去30天内。
change_event.change_date_time - 不能选择性能指标(例如不支持;仅可选择
metrics.*属性和允许的资源字段)。change_event
- 必须指定
GAQL查询示例: 查询客户账户在{customer_id}至{start_date}期间的变更事件:{end_date}sqlSELECT change_event.change_date_time, change_event.change_resource_name, change_event.resource_change_operation, change_event.changed_fields FROM change_event WHERE change_event.change_date_time >= '{start_date}' AND change_event.change_date_time <= '{end_date}' LIMIT 10000 - 注意事项(change_event约束):查询
4. Offline Upload Pipeline Diagnostics
4. 离线上传管道诊断
When offline conversion uploads for a specific action (e.g., store-purchase) stop showing up or fail, use the following steps to diagnose the issue.
Steps:
-
Retrieve Client Accounts: Ifis not provided, first call the
{customer_id}(orlist_accessible_customers) tool to retrieve the customer resource names/IDs you have access to. Then, query thecustomers_list_accessible_customersresource to find active client customer accounts, ensuring you filter out manager accounts and deactivated/canceled accounts to avoid query errors.customer_clientExample GAQL Query:sqlSELECT customer_client.id, customer_client.descriptive_name, customer_client.status, customer_client.manager FROM customer_client WHERE customer_client.status = 'ENABLED' AND customer_client.manager = FALSE -
Verify Pipeline Health: Queryfor the active client account.
offline_conversion_upload_conversion_action_summary- Fields: Include ,
offline_conversion_upload_conversion_action_summary.conversion_action_name,offline_conversion_upload_conversion_action_summary.successful_event_count, andoffline_conversion_upload_conversion_action_summary.total_event_count.offline_conversion_upload_conversion_action_summary.status
Example GAQL Query:sqlSELECT offline_conversion_upload_conversion_action_summary.conversion_action_name, offline_conversion_upload_conversion_action_summary.successful_event_count, offline_conversion_upload_conversion_action_summary.total_event_count, offline_conversion_upload_conversion_action_summary.status FROM offline_conversion_upload_conversion_action_summary - Fields: Include
-
Analyze:
- Gotcha: If the query to returns no results or is empty (indicating there are no offline conversion uploads configured or active for the customer account), immediately stop/break the diagnostic workflow. Report directly to the user that no offline conversion upload data or summaries exist in the accessible account(s), rather than retrying or attempting to generate custom scripts.
offline_conversion_upload_conversion_action_summary - If results are returned, verify the upload success rate by comparing with
successful_event_count. Check thetotal_event_countfield to diagnose failures.status
- Gotcha: If the query to
当特定操作(例如到店购买)的离线转化上传停止显示或失败时,使用以下步骤诊断问题。
步骤:
-
获取客户账户:如果未提供,先调用
{customer_id}(或list_accessible_customers)工具获取您有权访问的客户资源名称/ID。然后查询customers_list_accessible_customers资源以找到活跃的客户账户,确保过滤掉管理账户和已停用/取消的账户,避免查询错误。customer_clientGAQL查询示例:sqlSELECT customer_client.id, customer_client.descriptive_name, customer_client.status, customer_client.manager FROM customer_client WHERE customer_client.status = 'ENABLED' AND customer_client.manager = FALSE -
验证管道健康状况:针对活跃客户账户查询。
offline_conversion_upload_conversion_action_summary- 字段:包含、
offline_conversion_upload_conversion_action_summary.conversion_action_name、offline_conversion_upload_conversion_action_summary.successful_event_count和offline_conversion_upload_conversion_action_summary.total_event_count。offline_conversion_upload_conversion_action_summary.status
GAQL查询示例:sqlSELECT offline_conversion_upload_conversion_action_summary.conversion_action_name, offline_conversion_upload_conversion_action_summary.successful_event_count, offline_conversion_upload_conversion_action_summary.total_event_count, offline_conversion_upload_conversion_action_summary.status FROM offline_conversion_upload_conversion_action_summary - 字段:包含
-
分析:
- 注意事项:如果对的查询无结果或为空(表明该客户账户未配置或未启用离线转化上传),请立即停止诊断流程。直接向用户报告可访问账户中不存在离线转化上传数据或汇总信息,不要重试或尝试生成自定义脚本。
offline_conversion_upload_conversion_action_summary - 如果返回结果,通过比较与
successful_event_count验证上传成功率。查看total_event_count字段诊断失败原因。status
- 注意事项:如果对