零指标
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
搜索结果中指标为零的情况
执行查询时,您可能会遇到值为零的实体的指标。可能的原因如下:
- 这些实体不符合展示条件。
- 系统可能已在该报告的日期范围内暂停这些实体。
您往往需要通过查询结果获取有关广告系列效果的信息。在这种情况下,零指标可能并不是您所想要的。要生成更有用的报告,您可以明确排除指标值为零的情况。
使用谓词排除指标值为零的情况
谓词是一个求值结果为 TRUE
、FALSE
或 UNKNOWN
的表达式。它们用于 Search Ads 360 Reporting API 中 WHERE
子句的搜索条件。
以下查询演示了如何使用谓词明确移除指标值为零的情况:
SELECT
campaign.id,
metrics.impressions
FROM campaign
WHERE metrics.impressions > 0
通过细分排除指标为零的情况
细分报告时会始终排除指标为零的情况,前提是所有选定的指标均为零(请参阅下文)。
在搜索查询中添加任意 segments
字段即可对报告进行细分。例如,如果您按 segments.date
对报告进行细分,则指标将细分为每个日期一行。此类报告不会返回任何没有指标的日期。
对于以下查询,报告不会包含零指标行:
SELECT
campaign.name,
metrics.impressions,
segments.date
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
返回的指标为零的行
默认情况下,如果查询针对所有所选指标返回的指标均为零,则相应行会从报告中排除。自定义列不适用。
在此示例查询中,如果过去 30 天内任何一天的 impressions
指标都不存在,则报告中将省略该天的相应行。
SELECT
campaign.name,
metrics.impressions,
segments.date
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
在此示例查询中,只有当某天的 impressions
、clicks
和 conversions
指标均为零时,该天的相应行才会从结果中排除。
SELECT
campaign.name,
metrics.impressions,
metrics.clicks,
metrics.conversions,
segments.date
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eZero metrics in Search Ads 360 reports can indicate ineligible entities or paused entities within the report's timeframe.\u003c/p\u003e\n"],["\u003cp\u003eYou can refine your reports by explicitly excluding zero metrics using a predicate in the \u003ccode\u003eWHERE\u003c/code\u003e clause, ensuring that only meaningful data is displayed.\u003c/p\u003e\n"],["\u003cp\u003eSegmenting reports by fields like \u003ccode\u003esegments.date\u003c/code\u003e automatically removes zero metric rows when all selected metrics are zero for a particular segment.\u003c/p\u003e\n"],["\u003cp\u003eBy default, Search Ads 360 reports exclude rows with zero values for all selected metrics, simplifying report analysis and focusing on significant data points.\u003c/p\u003e\n"]]],["Zero metrics in search results can occur due to ineligibility or pausing. To exclude them and generate more useful reports, use predicates in the `WHERE` clause, like `metrics.impressions \u003e 0`. Alternatively, segmenting the report by any `segments` field, such as `segments.date`, automatically excludes rows where all selected metrics are zero. By default, rows with zero metrics for all *selected* metrics are omitted from reports, but this does not apply to Custom Columns.\n"],null,["# Zero Metrics\n\nZero metrics in search results\n------------------------------\n\nWhen you execute a query, you may encounter metrics for entities that\nare zero. This could be because:\n\n- The entities are ineligible for display.\n- They could have been paused within the report's date range.\n\nWith query results, you often want to obtain information about how your\ncampaigns are performing. In this context, zero metrics may not be\ndesirable. To produce a more useful report, you can explicitly exclude zero\nmetrics.\n\nExclude zero metrics with a predicate\n-------------------------------------\n\nA predicate is an expression that evaluates to `TRUE`, `FALSE`, or `UNKNOWN`.\nThey are used in the search condition of the `WHERE` clauses in\n[Search Ads 360 Reporting API](/search-ads/reporting/query/query-language#where_clause).\n\nThe following query demonstrates how to explicitly remove zero metrics with\na predicate: \n\n SELECT\n campaign.id,\n metrics.impressions\n FROM campaign\n WHERE metrics.impressions \u003e 0\n\nExclude zero metrics by segmenting\n----------------------------------\n\nZero metrics are always excluded when segmenting a report, provided all\n*selected* metrics are zero (see [below](#rows_returned)).\n\nSegmenting a report is done by including any `segments` field in the search\nquery. For example, if you segment a report by `segments.date`, metrics are\nbroken down with one row for each date. Dates with no metrics are not returned\nin such a report.\n\nFor the following query, the report won't include zero metric rows: \n\n SELECT\n campaign.name,\n metrics.impressions,\n segments.date\n FROM campaign\n WHERE segments.date DURING LAST_30_DAYS\n\nReturned rows with zero metrics\n-------------------------------\n\nRows for which a query returns zero metrics for **all** selected metrics are\nexcluded from your reports by default. Custom Columns don't apply.\n\nIn this example query, if there are no `impressions` metrics for any day in the\nlast 30 days, the row for that day will be omitted from the report. \n\n SELECT\n campaign.name,\n metrics.impressions,\n segments.date\n FROM campaign\n WHERE segments.date DURING LAST_30_DAYS\n\nIn this example query, the row for any day will only be excluded from your\nresults if there are zero `impressions`, `clicks` **and** `conversions` metrics\nfor that day. \n\n SELECT\n campaign.name,\n metrics.impressions,\n metrics.clicks,\n metrics.conversions,\n segments.date\n FROM campaign\n WHERE segments.date DURING LAST_30_DAYS"]]