过滤后的报告
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
默认情况下,您的报告将包含reportScope中
如果您希望报表中只包含与一组
条件,您可以向报告添加一个或多个过滤器。仅限满足所有过滤条件的行
返回的值。
例如,您可以请求针对某代理机构中的所有关键字生成报表。然后
您可以指定一个过滤条件,以便仅显示着陆页网址以
www.example.com 和 www.another-example.com 出现在报告中。
"filters": [
{
"column" : { "columnName": "keywordLandingPage" },
"operator" : "startsWith",
"values" : [
"http://www.example.com",
"http://www.another-example.com"
]
}
]
每个过滤器都指定了要过滤的列、运算符以及
应位于指定的列中:
"filters": [
{
"column" : column to filter on,
"operator" : operator specifying the type of filter,
"values" : list of values
},
{ ... another filter can go here ... }
]
注意:某些列无法过滤。在“报告参考类型”中,每列都表示
设为 Filterable
。
过滤条件运算符
所有过滤条件均区分大小写。也就是说,过滤器为“www.Sprockets.com”不匹配
包含“www.sprockets.com”的列。
运算符 |
说明 |
支持的值数量 |
equals |
该列必须与指定的值完全匹配。 |
1 |
notEquals |
该列不得与指定值匹配。 |
1 |
in |
该列必须与过滤条件列表中的某个值完全匹配。
不适用于列表数据类型(例如 String list )。
|
不定额 |
lessThan |
该列包含的值必须小于指定值。
如果您为 Boolean 列指定此过滤条件,则 Search Ads 360 API 会将 false 转换为
转换为数值 0 和 true 到 1 。如果
您为 String 列指定此过滤条件后,API 会将
字典顺序。
不适用于列表数据类型(例如 String list )。
|
1 |
greaterThan |
此列包含的值必须大于
过滤器的列表。
如果您为 Boolean 列指定此过滤条件,则 API 会转换 false
转换为数值 0 和 true 到 1 。如果
您为 String 列指定此过滤条件后,API 会将
字典顺序。
不适用于列表数据类型(例如 String list )。
|
1 |
lessThanOrEqual |
该列包含的值必须小于或等于
值。
如果您为 Boolean 列指定此过滤条件,则 API 会转换 false
转换为数值 0 和 true 到 1 。如果
您为 String 列指定此过滤条件后,API 会将
字典顺序。
不适用于列表数据类型(例如 String list )。
|
1 |
greaterThanOrEqual |
该列包含的值必须大于或等于
值。
如果您为 Boolean 列指定此过滤条件,则 API 会转换 false
转换为数值 0 和 true 到 1 。如果
您为 String 列指定此过滤条件后,API 会将
字典顺序。
不适用于列表数据类型(例如 String list )。
|
1 |
isNull |
此列必须为空。例如,如果您指定 isNull
关键字报表中的 keywordMaxCpc 列时,
将仅包含未指定最高每次点击费用的关键字。
|
0 |
isNotNull |
该列必须包含值。 |
0 |
startsWith |
此列必须以过滤器列表中的某个字符串开头。
仅对 String 列有效。
|
不定额 |
containsSubstring |
该列必须包含
过滤器的列表。
例如,具有以下值的 containsSubstring 过滤条件:
["ham", "cheese"]
将返回采用以下值的行:
hamburger
cheeseburger
但不会返回具有以下值的行:
lobster roll
lettuce
high amplitude (high amplitude 包括
子字符串“h am”,但过滤器将评估所有字符(包括空格)
仅对 String 列有效。
|
不定额 |
doesNotContainSubstring |
该列不得包含过滤器列表中的任何字符串。
例如,值为 的 doesNotContainSubstring 过滤条件
["ham", "cheese"]
将返回采用以下值的行:
lobster roll
lettuce
但不会返回具有以下值的行:
汉堡汉堡
奶酪汉堡
仅对 String 列有效。
|
不定额 |
containsElement |
该列必须至少包含过滤器列表中的一个值。
仅对具有列表数据类型(例如 String list )的列有效。
例如,在 campaign 报告中,
值为 containsElement 的过滤条件:
["foo", "bar"]
根据 effectiveLabels 列进行过滤
则只会返回标有 foo 和/或 bar 的广告系列。
|
不定额 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-20。
[null,null,["最后更新时间 (UTC):2024-08-20。"],[[["\u003cp\u003eThe new Search Ads 360 Reporting API offers enhanced flexibility for building custom reports and data integration.\u003c/p\u003e\n"],["\u003cp\u003eReports can be filtered to show specific data by defining criteria using filters.\u003c/p\u003e\n"],["\u003cp\u003eFilters are case-sensitive and operate on various data types with different operators like \u003ccode\u003eequals\u003c/code\u003e, \u003ccode\u003estartsWith\u003c/code\u003e, \u003ccode\u003econtainsSubstring\u003c/code\u003e, and more.\u003c/p\u003e\n"],["\u003cp\u003eSome columns are not filterable, and the 'Types of Reports' reference indicates filterable columns.\u003c/p\u003e\n"],["\u003cp\u003eA table provides a detailed explanation of each filter operator, its function, and the number of values it supports.\u003c/p\u003e\n"]]],["The new Search Ads 360 Reporting API allows users to create custom reports and integrate data into applications. Reports can be filtered to show specific data based on criteria using filters. These filters specify a column, an operator (like `equals`, `startsWith`), and values. Multiple filters can be combined, and only rows matching all filters are returned. Operators vary in their functionality, such as checking for equality, substring presence, or numerical comparisons. Filters are case-sensitive, and filterability is column-specific.\n"],null,["# Filtered Reports\n\nThe new Search Ads 360 Reporting API is now available. The new API provides enhanced flexibility to build custom reports and integrate the data into your reporting applications and processes. Learn more about migrating to and using the [new Search Ads 360 Reporting\nAPI](https://developers.google.com/search-ads/reporting/overview).\n\n\nBy default, your report will contain all of the data within the [reportScope](/search-ads/v2/reference/reports#request.reportScope) that\nyour request specifies. If you want a report to contain only the data that matches a set of\ncriteria, you can add one or more filters to a report. Only rows that satisfy all filters\nare returned.\n\nFor example, you can request a report of all the keywords in an agency. Then\nyou can specify a filter so that only keywords with landing page URLs starting with\nwww.example.com and www.another-example.com appear in the report. \n\n```\n\"filters\": [\n {\n \"column\" : { \"columnName\": \"keywordLandingPage\" },\n \"operator\" : \"startsWith\",\n \"values\" : [\n \"http://www.example.com\",\n \"http://www.another-example.com\"\n ]\n }\n]\n```\n\nEach filter specifies a column to be filtered, an operator, and a list of values that\nare expected to be in the specified column: \n\n```\n\"filters\": [\n {\n \"column\" : column to filter on,\n \"operator\" : operator specifying the type of filter,\n \"values\" : list of values\n },\n { ... another filter can go here ... }\n]\n``` \n**Note** : Some columns cannot be filtered. In the Types of Reports reference, each column indicates if it is `Filterable`.\n\nFilter operators\n----------------\n\nAll filters are case sensitive. That is, a filter with \"www.Sprockets.com\" will not match\na column that contains \"www.sprockets.com\". \n\n| Operator | Description | Number of values supported |\n|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|\n| `equals` | The column must exactly match the specified value. | 1 |\n| `notEquals` | The column must not match the specified value. | 1 |\n| `in` | The column must exactly match one of the values in the filter's list. Not valid for list data types (such as `String list`). | variable |\n| `lessThan` | The column must contain a value that is less than the specified value. If you specify this filter for a `Boolean` column, the Search Ads 360 API converts `false` to a numeric value of `0` and `true` to `1`. If you specify this filter for a `String` column, the API compares the lexicographic order. Not valid for list data types (such as `String list`). | 1 |\n| `greaterThan` | The column must contain a value that is greater than one of the values in the filter's list. If you specify this filter for a `Boolean` column, the API converts `false` to a numeric value of `0` and `true` to `1`. If you specify this filter for a `String` column, the API compares the lexicographic order. Not valid for list data types (such as `String list`). | 1 |\n| `lessThanOrEqual` | The column must contain a value that is less than or equal to one of the values in the filter's list. If you specify this filter for a `Boolean` column, the API converts `false` to a numeric value of `0` and `true` to `1`. If you specify this filter for a `String` column, the API compares the lexicographic order. Not valid for list data types (such as `String list`). | 1 |\n| `greaterThanOrEqual` | The column must contain a value that is greater than or equal to one of the values in the filter's list. If you specify this filter for a `Boolean` column, the API converts `false` to a numeric value of `0` and `true` to `1`. If you specify this filter for a `String` column, the API compares the lexicographic order. Not valid for list data types (such as `String list`). | 1 |\n| `isNull` | The column must be empty. For example, if you specify `isNull` for the `keywordMaxCpc` column in a [keyword report](/search-ads/v2/report-types/keyword), the report will contain only keywords that have not specified a Max CPC. | 0 |\n| `isNotNull` | The column must contain a value. | 0 |\n| `startsWith` | The column must start with one of the strings in the filter's list. Only valid for `String` columns. | variable |\n| `containsSubstring` | The column must contain all or part of one of the strings specified in the filter's list. For example, a `containsSubstring` filter with the values: `[\"ham\", \"cheese\"]` would return rows with this value: **ham**`burger` **cheese**`burger` but would not return rows with these values: `lobster roll` `lettuce` `hig`**h am**`plitude` (`high amplitude` includes the substring \"h am\", but all characters---including spaces---are evaluated by the filter) Only valid for `String` columns. | variable |\n| `doesNotContainSubstring` | The column must not contain any of the strings in the filter's list. For example, a `doesNotContainSubstring` filter with the values: `[\"ham\", \"cheese\"]` would return rows with this value: `lobster roll` `lettuce` but would not return rows with these values: **ham** burger **cheese**burger Only valid for `String` columns. | variable |\n| `containsElement` | The column must contain at least one of values in the filter's list. Only valid for columns with list data types (such as `String list`). For example in a `campaign` report, a `containsElement` filter with the values: `[\"foo\", \"bar\"]` filtering on the `effectiveLabels` column would only return campaigns labeled with `foo`, `bar`, or both. | variable |"]]