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.
Ngôn ngữ truy vấn Search Ads 360 cho phép bạn tạo truy vấn tìm kiếm để truy xuất dữ liệu báo cáo và siêu dữ liệu tài nguyên bằng API Báo cáo Search Ads 360.
Dịch vụ tìm kiếm
Bạn có thể sử dụng Ngôn ngữ truy vấn Search Ads 360 để truy vấn API bằng:
Sử dụng dịch vụ này để truy vấn siêu dữ liệu về các trường và tài nguyên có sẵn.
Dịch vụ này cung cấp một danh mục các trường có thể truy vấn với thông tin cụ thể về khả năng tương thích và loại của các trường đó.
SearchAds360FieldService trả về danh sách các thực thể SearchAds360Field:
Mỗi trường chứa thông tin chi tiết về trường được yêu cầu.
Truy vấn này trả về những chiến dịch có trạng thái PAUSED và hơn 1.000 lượt hiển thị.
Chế độ xem này phân đoạn dữ liệu theo ngày.
Do quá trình phân đoạn, mỗi SearchAds360Row đại diện cho một bộ dữ liệu của một chiến dịch và phân khúc ngày.
Truy vấn sắp xếp theo mã chiến dịch.
Hãy xem segments để biết danh sách các phân khúc mà bạn có thể dùng trong các truy vấn và bài viết về Phân đoạn để biết thêm thông tin về cách phân đoạn báo cáo.
Truy vấn các thuộc tính của một tài nguyên có liên quan
Đây là truy vấn cơ bản trên tài nguyên campaign, kết hợp các thuộc tính của tài nguyên bidding_strategy (nếu có). Loại tài nguyên có liên quan này được gọi là tài nguyên được phân bổ.
Truy vấn này sẽ chọn các thuộc tính chiến dịch và các thuộc tính liên quan từ từng chiến dịch đã chọn.
Mỗi SearchAds360Row được trả về đại diện cho một đối tượng campaign được điền sẵn các thuộc tính chiến dịch đã chọn, cũng như thuộc tính chiến lược đặt giá thầu đã chọn, bidding_strategy.name.
Hãy xem campaign để tìm hiểu những tài nguyên được phân bổ có sẵn cho các truy vấn chiến dịch.
Thay thế RESOURCE OR FIELD (TÀI NGUYÊN HOẶC TRƯỜNG) bằng một tài nguyên (chẳng hạn như customer hoặc campaign) hoặc một trường (chẳng hạn như campaign.id, metrics.impressions hoặc ad_group.id).
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eThe Search Ads 360 Query Language enables you to construct search queries for retrieving reporting data and resource metadata via the Search Ads 360 Reporting API.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize the \u003ccode\u003eSearchAds360Service\u003c/code\u003e to query resources, attributes, segments, and metrics, while the \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e helps you retrieve metadata about available fields and resources.\u003c/p\u003e\n"],["\u003cp\u003eQueries can be structured to retrieve attributes of resources, associated metrics, segments for specific timeframes, and related resource attributes.\u003c/p\u003e\n"],["\u003cp\u003eMetadata about fields can be retrieved by querying the \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e with the desired field name.\u003c/p\u003e\n"]]],["The Search Ads 360 Query Language allows data retrieval via two services: `SearchAds360Service` and `SearchAds360FieldService`. The former fetches resource data using `Search` and `SearchStream` methods, returning rows with attributes, metrics, and segments. The latter retrieves metadata about available fields, detailing compatibility and type. Example queries demonstrate selecting attributes, metrics, segments, and related resource attributes. Metadata queries use `SearchAds360FieldService` to detail fields.\n"],null,["# Search Ads 360 Query Language\n\nThe Search Ads 360 Query Language allows you to build search queries to retrieve\nreporting data and resource metadata using the Search Ads 360 Reporting API.\n\nSearch services\n---------------\n\nYou can use the Search Ads 360 Query Language to query the API using:\n\n[`SearchAds360Service`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360service)\n\n: Use this service to query resources and their related attributes, segments,\n and metrics. There are two methods, *`Search`* and *`SearchStream`*.\n\n `SearchAds360Service` queries return a list of [`SearchAds360Row`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360row) instances:\n\n - Each row represents a resource.\n - If requested, rows include attributes and metric fields.\n - If you request segments, additional rows are included for each segment-resource tuple.\n\n See [Create search reports](/search-ads/reporting/concepts/search-reports) for\n more information.\n\n[`SearchAds360FieldService`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360fieldservice)\n\n: Use this service to query for metadata about available fields and resources.\n The service provides a catalog of queryable fields with specifics about their\n compatibility and type.\n\n `SearchAds360FieldService` returns a list of [`SearchAds360Field`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.resources#searchads360field)\n instances:\n\n - Each field contains details about the requested field.\n\n See [Retrieve resource metadata](/search-ads/reporting/concepts/resource-metadata) to learn more.\n\nBasic query examples\n--------------------\n\nThe following sections provide basic query examples that you can adapt to build\nyour own queries.\n\n### Query for attributes of a resource\n\nThis is a basic query for attributes of the `campaign` resource that returns\nthe campaign ID, name, and status: \n\n SELECT\n campaign.id,\n campaign.name,\n campaign.status\n FROM campaign\n ORDER BY campaign.id\n\n- Each returned `SearchAds360Row` represents a `campaign` object.\n- Rows are populated with the selected fields (including the given campaign's `resource_name`).\n- The query orders by campaign ID.\n\nSee [`campaign`](/search-ads/reporting/api/reference/fields/v0/campaign) for\nother available fields you can use in your queries.\n\n### Query for metrics\n\nThis is a basic query for metrics related to attributes of the `campaign`\nresource: \n\n SELECT\n campaign.id,\n campaign.name,\n campaign.status,\n metrics.impressions\n FROM campaign\n WHERE campaign.status = 'PAUSED'\n AND metrics.impressions \u003e 1000\n ORDER BY campaign.id\n\n- The query returns campaigns with the status `PAUSED` and more than 1000 impressions.\n- Each returned `SearchAds360Row` has a `metrics` field populated with the selected metrics.\n- The query orders by campaign ID.\n\nSee [`metrics`](/search-ads/reporting/api/reference/fields/v0/metrics) for other\navailable metrics you can use in your queries.\n\n### Query for segments\n\nThis is a basic query for segments related to attributes of the `campaign`\nresource: \n\n SELECT\n campaign.id,\n campaign.name,\n campaign.status,\n metrics.impressions,\n segments.date,\n FROM campaign\n WHERE campaign.status = 'PAUSED'\n AND metrics.impressions \u003e 1000\n AND segments.date during LAST_30_DAYS\n ORDER BY campaign.id\n\n- The query returns campaigns with the status `PAUSED` and more than 1000 impressions.\n- It segments the data by date.\n- As a result of the segmentation, each `SearchAds360Row` represents a tuple of a campaign and the date segment.\n- The query orders by campaign ID.\n\nSee [`segments`](/search-ads/reporting/api/reference/fields/v0/segments#segments.date) for a\nlist of segments you can use in your queries and [Segmentation](/search-ads/reporting/concepts/search-reports#segmentation) for more\ninformation about segmenting your reports.\n\n### Query for attributes of a related resource\n\nThis is a basic query on the `campaign` resource that joins attributes of the\n`bidding_strategy` resource, if available. This type of related resource is\nknown as an attributed resource. \n\n SELECT\n campaign.id,\n campaign.name,\n campaign.status,\n bidding_strategy.name\n FROM campaign\n ORDER BY campaign.id\n\n- The query selects campaign attributes and related attributes from each campaign selected.\n- Each returned `SearchAds360Row` represents a `campaign` object populated with the selected campaign attributes, as well as, the selected bidding strategy attribute, `bidding_strategy.name`.\n\nSee [`campaign`](/search-ads/reporting/api/reference/fields/v0/campaign#campaign.bidding_strategy_type)\nto find out which attributed resources are available for campaign queries.\n\n### Query for field metadata\n\nYou can use [`SearchAds360FieldService`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360fieldservice)\nto retrieve field metadata.\n\nThis is a basic query for field metadata: \n\n```sql\nSELECT\n name,\n category,\n selectable,\n filterable,\n sortable,\n selectable_with,\n data_type,\n is_repeated\nWHERE name = RESOURCE/FIELD\n```\n\n- Replace RESOURCE OR FIELD with either a resource (such as, `customer` or `campaign`) or a field (such as, `campaign.id`, `metrics.impressions`, or `ad_group.id`).\n\n| **Note:** These is no `FROM` clause in a query for field metadata.\n\nSee [Retrieve resource metadata](/search-ads/reporting/concepts/resource-metadata) for more information about retrieving field\nmetadata.\n\nLearn more\n----------\n\nLearn more about how to build queries in the Search Ads 360 Reporting API:\n\n- [Query structure and clauses](/search-ads/reporting/query/query-structure)\n- [Date ranges](/search-ads/reporting/query/date-ranges)\n- [Zero metrics](/search-ads/reporting/query/zero-metrics)\n- [Sample queries](/search-ads/reporting/query/sample-queries)\n- [Query grammar](/search-ads/reporting/query/query-grammar)"]]