API Báo cáo Search Ads 360 mới hiện đã ra mắt. Tham gia nhóm Google searchads-api-announcements để luôn được cập nhật về những cải tiến và bản phát hành sắp tới.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn có thể sử dụng SearchAds360FieldService để linh động yêu cầu danh mục cho tài nguyên, trường của tài nguyên, khoá phân đoạn và chỉ số có trong phương thức SearchAds360ServiceSearch và SearchStream. Danh mục này cung cấp siêu dữ liệu mà ứng dụng API Báo cáo Search Ads 360 có thể sử dụng để xác thực và tạo câu lệnh Ngôn ngữ truy vấn Search Ads 360.
Yêu cầu và phản hồi HTTP mẫu
Yêu cầu này bao gồm một HTTP GET đến máy chủ API Báo cáo Search Ads 360 tại
URL sau:
Các tài nguyên có thể được tham gia ngầm ẩn vào tài nguyên trong mệnh đề FROM.
metrics
Các chỉ số có thể được chọn cùng với tài nguyên trong mệnh đề FROM. Chỉ được điền sẵn cho các trường có category là RESOURCE.
segments
Các khoá phân đoạn có thể được chọn bằng tài nguyên trong mệnh đề FROM.
Các chỉ số này phân đoạn các chỉ số được chỉ định trong truy vấn. Chỉ được điền sẵn cho các trường có category là RESOURCE.
selectableWith
Các trường có thể được chọn cùng với một trường nhất định, khi không nằm trong mệnh đề FROM. Thuộc tính này chỉ có liên quan khi xác định các tài nguyên hoặc phân đoạn có thể được chọn trong một truy vấn mà tài nguyên không đưa các phân đoạn đó vào mệnh đề FROM. Ví dụ: nếu bạn chọn ad_group.id và segments.date từ ad_group và muốn thêm các thuộc tính từ campaign, thì bạn cần kiểm tra để đảm bảo rằng segments.date nằm trong thuộc tính selectableWith cho chiến dịch, vì thuộc tính này được chọn cùng với trường segments.date hiện có.
Thông tin chi tiết về siêu dữ liệu
Bạn có thể yêu cầu danh mục bằng cách sử dụng SearchAds360FieldService ở các cấp độ sau:
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eUse \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e to dynamically retrieve metadata about resources, fields, segmentation keys, and metrics available in Search Ads 360 Reporting API.\u003c/p\u003e\n"],["\u003cp\u003eThis metadata helps in validating and constructing Search Ads 360 Query Language statements for use with the \u003ccode\u003eSearch\u003c/code\u003e and \u003ccode\u003eSearchStream\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eRequest the catalog for resources, resource fields, segmentation fields, and metrics using the specified URL structure.\u003c/p\u003e\n"],["\u003cp\u003eExplore the catalog metadata including \u003ccode\u003eattributeResources\u003c/code\u003e, \u003ccode\u003emetrics\u003c/code\u003e, \u003ccode\u003esegments\u003c/code\u003e, and \u003ccode\u003eselectableWith\u003c/code\u003e for query construction.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003esearch\u003c/code\u003e method of \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e to query for specific field details using regular expressions or specific field names.\u003c/p\u003e\n"]]],["`SearchAds360FieldService` provides a dynamic catalog of resources, fields, segmentation keys, and metrics for `SearchAds360Service`. This service allows clients to validate and construct Search Ads 360 Query Language statements. The catalog can be requested via HTTP GET, for instance, `searchAds360Fields/ad_group`. Responses include `attributeResources`, `metrics`, `segments`, and `selectableWith`. You can also retrieve field details using a query to `searchAds360Fields:search`, allowing for filtering with regular expressions or specific field names.\n"],null,["# Resource Metadata\n\nYou can use [`SearchAds360FieldService`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#google.ads.searchads360.v0.services.SearchAds360FieldService)\nto dynamically request the catalog for resources, resource's fields,\nsegmentation keys and metrics available in the [`SearchAds360Service`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360service)\n`Search` and `SearchStream` methods. The catalog provides metadata that can be\nused by Search Ads 360 Reporting API clients for validation and construction of Search Ads 360\nQuery Language statements.\n\nSample HTTP request and response\n--------------------------------\n\n| **Note:** The example shows the underlying HTTP/JSON request as a guide, but you are strongly encouraged to use one of the [client libraries](/search-ads/reporting/client-libraries/client-libraries) based on [gRPC](//grpc.io) to submit your requests.\n\nThe request consists of an `HTTP GET` to the Search Ads 360 Reporting API server at the\nfollowing URL: \n\n https://searchads360.googleapis.com/v0/searchAds360Fields/{resource_or_field}\n\nThe following is an example of a request followed by the response returned from\n`SearchAds360FieldService` for **ad_group** resource:\n\n### Request\n\n https://searchads360.googleapis.com/v0/searchAds360Fields/ad_group\n\n### Response\n\n {\n \"resourceName\": \"searchAds360Fields/ad_group\",\n \"name\": \"ad_group\",\n \"category\": \"RESOURCE\",\n \"selectable\": false,\n \"filterable\": false,\n \"sortable\": false,\n \"selectableWith\": [\n \"campaign\",\n \"customer\",\n \"metrics.average_cpc\",\n \"segments.device\",\n ...\n ],\n \"attributeResources\": [\n \"customer\",\n \"campaign\"\n ],\n\n \"metrics\": [\n \"metrics.conversions\",\n \"metrics.search_budget_lost_impression_share\",\n \"metrics.average_cost\",\n \"metrics.clicks\",\n ...\n ],\n \"segments\": [\n \"segments.date\",\n \"segments.ad_network_type\",\n \"segments.device\",\n ...\n ]\n }\n\nFor this example, the important arrays are:\n\n`attributeResources`\n: Resources that can be implicitly joined to the resource in the `FROM`\n clause.\n\n`metrics`\n: Metrics that are available to be selected with the resource in the `FROM`\n clause. Only populated for fields where the `category` is `RESOURCE`.\n\n`segments`\n: Segment keys that can be selected with the resource in the `FROM` clause.\n These segment the metrics specified in the query. Only populated for fields\n where the `category` is `RESOURCE`.\n\n`selectableWith`\n: Fields that can be selected alongside a given field, when not in the `FROM`\n clause. This attribute is only relevant when identifying resources or segments\n that are able to be selected in a query where they are not included by the\n resource in the `FROM` clause. As an example, if you are selecting `ad_group.id`\n and `segments.date` from `ad_group`, and you want to include attributes from\n `campaign`, you would need to check that `segments.date` is in the\n `selectableWith` attribute for campaign, since it's being selected alongside the\n existing `segments.date` field.\n\nMetadata details\n----------------\n\nYou can request the catalog using the `SearchAds360FieldService` at these\nlevels:\n\nResource\n: For example, `searchAds360Fields/campaign`.\n\nResource's field\n: For example, `searchAds360Fields/campaign.name`.\n\nSegmentation field\n: For example, `searchAds360Fields/segments.ad_network_type`.\n\nMetric\n: For example, `searchAds360Fields/metrics.clicks`.\n\nUse a query to get field details\n--------------------------------\n\nIt is possible to get field details by sending a query to \n\n https://searchads360.googleapis.com/v0/searchAds360Fields:search\n\nExample 1: Using a regular expression. \n\n SELECT\n name,\n category,\n selectable,\n filterable,\n sortable,\n selectable_with,\n data_type,\n is_repeated\n WHERE name LIKE 'ad_group.%'\"\n\nExample 2: Querying specific fields, metrics or segments. \n\n SELECT\n name,\n category,\n selectable,\n filterable,\n sortable,\n selectable_with,\n data_type,\n is_repeated\n WHERE\n name IN (\n \"ad_group.id\",\n \"ad_group.name\",\n \"segments.date\",\n \"customer.id\",\n \"customer.manager\",\n \"metrics.clicks\"\n )"]]