想分享對 Google Ads API 的意見嗎?
立即註冊,等待受邀參與使用者研究調查!
資源名稱
如果您知道與該實體相關的所有 ID,ResourceNames 公用程式可用於建構實體的資源名稱。舉例來說,廣告活動資源名稱的格式為 customers/<CUSTOMER_ID>/campaigns/<CAMPAIGN_ID>
,因此如果您知道客戶 ID 和廣告活動 ID,就可以使用 ResourceNames
公用程式建構完整資源名稱。
如果 $customerId
包含您的客戶 ID,而 $campaignId
包含廣告活動 ID,您可以使用 forCampaign 取得廣告活動的資源名稱,如下所示:
$campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId)
每個實體都有一組不同的 ID,組合起來就是資源名稱。舉例來說,廣告群組條件的資源名稱需要客戶 ID、廣告群組 ID 和廣告群組條件 ID。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-28 (世界標準時間)。
[null,null,["上次更新時間:2025-02-28 (世界標準時間)。"],[[["The `ResourceNames` utility helps build resource names for Google Ads entities using their respective IDs."],["You need to provide the necessary IDs, like customer ID and campaign ID, to construct a specific resource name."],["Each Google Ads entity type has a unique set of IDs required for its resource name, such as ad group criteria needing customer ID, ad group ID, and criterion ID."],["`ResourceNames` offers functions like `forCampaign` to easily generate resource names for specific entities."]]],[]]