零指標
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
搜尋結果中的零指標
執行查詢時,您可能會遇到實體的指標為零。可能的原因如下:
- 實體不符合顯示資格。
- 這些廣告可能在報表的日期範圍內暫停。
您通常會想透過查詢結果,取得廣告活動成效資訊。在這種情況下,零指標可能不是理想的結果。如要產生更有用的報表,您可以明確排除零指標。
使用述詞排除零指標
述詞是評估結果為 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
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間: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"]]