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.
Hệ phân cấp tên
Tên tài nguyên được dùng trong Search Ads 360 Reporting API có tính phân cấp, phản ánh cấu trúc của các thực thể trong Search Ads 360. Hầu hết các tài nguyên đều là tài nguyên phụ của tài nguyên Customer. Điều này phản ánh thực tế là hầu hết mọi lệnh gọi API đều phải nhắm đến một tài khoản Search Ads 360 cụ thể. Ví dụ: chiến dịch, nhóm quảng cáo, quảng cáo và từ khoá đều là tài nguyên phụ của một tài nguyên khách hàng gốc.
Các thực thể API Báo cáo Search Ads 360 (khách hàng, chiến dịch, v.v.) được tham chiếu theo tên tài nguyên trong toàn bộ API. Tuy nhiên, điều quan trọng cần lưu ý là bản thân tên tài nguyên có thể có mã nhận dạng tài nguyên bằng số duy nhất để xác định từng đối tượng trong hệ phân cấp. Trong những trường hợp này, bạn nên phân tích tên tài nguyên để trích xuất các mã nhận dạng tài nguyên này và lắp ráp một mã nhận dạng mới.
Ví dụ: hãy xem xét tên tài nguyên AdGroupAd trong bảng trước:
Bạn có thể chia thành các mã nhận dạng tài nguyên riêng lẻ (được phân tách bằng mã nhận dạng bộ sưu tập) như sau:
Thành phần tên tài nguyên
Mã nhận dạng tài nguyên
mã khách hàng:
"1234567890"
mã nhóm quảng cáo:
"54321098765"
mã quảng cáo nhóm quảng cáo:
"2109876543210"
Mã bộ sưu tập
"customers"
"adGroupAds"
Việc phân tích cú pháp các mã nhận dạng riêng lẻ cho phép bạn lấy tên tài nguyên mới để tham chiếu đến khách hàng của quảng cáo trong nhóm quảng cáo (customers/1234567890) hoặc nhóm quảng cáo của quảng cáo đó (customers/1234567890/adGroupAds/54321098765).
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eSearch Ads 360 Reporting API resource names are hierarchical, starting with the customer and followed by sub-resources like campaigns, ad groups, and ads.\u003c/p\u003e\n"],["\u003cp\u003eResource names use relative paths and contain numerical resource IDs for each entity in the hierarchy.\u003c/p\u003e\n"],["\u003cp\u003eYou can parse resource names to extract individual resource IDs and construct new resource names for related entities.\u003c/p\u003e\n"],["\u003cp\u003eIn JSON request and response bodies, resource names are identified by the \u003ccode\u003eresourceName\u003c/code\u003e field, not the \u003ccode\u003ename\u003c/code\u003e field.\u003c/p\u003e\n"]]],["The Search Ads 360 Reporting API uses a hierarchical structure for resource names, with most resources being sub-resources of the `Customer`. Each resource has a unique numerical ID within its resource name. Resource names are relative and can be parsed to extract these IDs. These IDs allow for the derivation of new resource names, referencing parent entities, like the customer or ad group. The `resourceName` field, not `name`, is used in JSON bodies.\n"],null,["# Resource Names\n\nName hierarchy\n--------------\n\nResource names used in the Search Ads 360 Reporting API are hierarchical, mirroring the\norganization of entities within Search Ads 360. Almost all resources are sub-resources\nof the [`Customer`](/search-ads/reporting/api/reference/rest/v0/customers.searchAds360)\nresource, which reflects the fact that almost every API call has to target a\nspecific Search Ads 360 account. For example, campaigns, ad groups, ads, and keywords\nare all sub-resources of a root customer resource.\n\n| Resource | Resource Name |\n|-----------|-------------------------------------------------------------|\n| Customer | `customers/1234567890` |\n| Campaign | `customers/1234567890/campaigns/8765432109` |\n| AdGroup | `customers/1234567890/adGroups/54321098765` |\n| AdGroupAd | `customers/1234567890/adGroupAds/54321098765~2109876543210` |\n\n| **Key Point:** The Search Ads 360 Reporting API uses [*relative* resource names](//cloud.google.com/apis/design/resource_names#relative_resource_name) (and not [*full* resource names](//cloud.google.com/apis/design/resource_names#full_resource_name) like some other Google APIs).\n\nResource IDs\n------------\n\nSearch Ads 360 Reporting API entities (customers, campaigns, etc.) are referred to by their resource\nnames throughout the API. However, it's important to note that the resource\nnames themselves may have unique numerical [resource\nIDs](//cloud.google.com/apis/design/resource_names#resource_id) that identify\neach object in the hierarchy. In these cases, it may be useful to parse the\nresource name to extract these resource IDs and assemble a new one.\n\nFor example, examine the `AdGroupAd` resource name from the previous table: \n\n customers/1234567890/adGroupAds/54321098765~2109876543210\n\nThis can be broken down into its individual resource IDs (separated by\n[collection IDs](//cloud.google.com/apis/design/resource_names#collection_id))\nas follows:\n\n| Resource name components ||\n|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Resource IDs** | |-----------------|-------------------| | customer ID: | `\"1234567890\"` | | ad group ID: | `\"54321098765\"` | | ad group ad ID: | `\"2109876543210\"` | |\n| **Collection IDs** | |----------------| | `\"customers\"` | | `\"adGroupAds\"` | |\n\nParsing the individual IDs lets you derive new resource names to reference\nthe ad group ad's customer (`customers/1234567890`) or its ad group\n(`customers/1234567890/adGroupAds/54321098765`).\n| **Key Point:** Resource names in JSON request and response bodies are referred to by the `resourceName` field, not the [`name`](//cloud.google.com/apis/design/resource_names#q_why_is_the_special_field_called_name_instead_of_id) field like in some other Google Cloud APIs. Many Search Ads 360 entities have name attributes themselves (`campaign.Name`, `adGroup.Name`, etc.), so `resourceName` is used to avoid collision with existing object names."]]