最高成效廣告活動批次處理
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
批次處理可讓您將一組作業 (可能相互依存) 分派至多項服務,而不必同步等待作業完成。您可以使用批次處理功能,建立及管理最高成效廣告活動。
本指南將詳細說明使用批次處理時,最高成效廣告活動的相關資訊。一般批次處理指南提供批次處理的一般資訊,而結構化要求指南則詳細說明如何建構要求,以建立或管理最高成效廣告活動。
如要使用批次處理功能建立最高成效廣告活動,請按照下列步驟操作:
建立新的批次工作
按照一般批次處理作業建立步驟,建立 BatchJob
資源。
準備變更作業清單
最高成效廣告活動需要作業才能建立多個相關資源,詳情請參閱結構要求指南。為批次工作中應包含的每個資源建立 MutateOperation
。
CampaignOperation
和 CampaignAssetOperation
需求條件
為廣告活動啟用品牌宣傳指南後 (請參閱品牌宣傳指南),您必須使用 CampaignAsset
資源將品牌素材資源連結至廣告活動。此外,在批次工作中,這些 CampaignAsset
資源的建立作業必須在 Campaign
資源本身建立後立即進行。如果 Campaign
資源建立後,CampaignAsset
資源並未立即建立 (啟用品牌宣傳指南時 - 請參閱疑難排解),要求就會失敗並傳回 CampaignError
,指出缺少資產。在同一份作業清單中稍後加入 CampaignAsset
建立作業,也無法避免這個錯誤。
AssetGroupOperation
和 AssetGroupAssetOperation
需求條件
由於系統會將作業分組處理,因此在批次作業中建立 AssetGroup
和 AssetGroupAsset
資源的 MutateOperation
類型作業必須依序執行,且不得穿插其他作業。否則,即使稍後在作業清單中加入符合最低素材資源規定的作業,要求仍會擲回AssetGroupError
,指出缺少部分素材資源。
AssetGroupListingGroupFilterOperation
最佳做法
在 AssetGroupListingGroupFilter
的情況下使用商品目錄群組篩選條件時,建議您將以相同 AssetGroup
為目標的 AssetGroupListingGroupFilterOperation
作業連續新增至批次工作,這樣在批次分割期間,系統就會將這組作業視為不可分割的單位。如要進一步瞭解批次分割和其他影響商店資訊群組的因素,請參閱商店資訊群組批次處理指南。
將變動作業新增至工作
將步驟 2 中的變動作業新增至清單,然後呼叫 AddBatchJobOperations
,將變動清單新增至步驟 1 中建立的批次作業。請按照一般批次處理指南中的新增作業步驟,新增變動作業清單。
執行批次工作
呼叫 RunBatchJob
,允許上傳的工作開始執行。如需範例,請參閱一般批次處理指南中的「執行批次工作」步驟。
擷取工作狀態
批次工作會以長時間執行的作業啟動,通常需要一段時間才能完成。
啟動工作後,請使用長時間執行的作業的 GetOperation
方法輪詢工作狀態,直到工作完成為止。
所有批次作業完成後,請按照一般批次處理指南中的「列出所有批次作業結果」步驟,呼叫 ListBatchJobResults
列印作業的狀態和回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-27 (世界標準時間)。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[[["\u003cp\u003eBatch processing allows you to execute a series of interdependent operations across Google Ads services, including creating and managing Performance Max campaigns, without waiting for each operation to complete individually.\u003c/p\u003e\n"],["\u003cp\u003eCreating a Performance Max campaign with batch processing involves preparing a list of \u003ccode\u003eMutateOperation\u003c/code\u003e objects, each defining a resource to be created or modified, such as an asset group or listing group filter.\u003c/p\u003e\n"],["\u003cp\u003eOperations involving \u003ccode\u003eAssetGroup\u003c/code\u003e and \u003ccode\u003eAssetGroupAsset\u003c/code\u003e resources should be sequential within the batch job due to their interdependencies and asset requirements.\u003c/p\u003e\n"],["\u003cp\u003eWhen using \u003ccode\u003eAssetGroupListingGroupFilter\u003c/code\u003e for Performance Max campaigns with online sales, it's recommended to add operations targeting the same \u003ccode\u003eAssetGroup\u003c/code\u003e consecutively to ensure atomic processing.\u003c/p\u003e\n"],["\u003cp\u003eThe batch job is executed asynchronously, requiring you to monitor its status using the \u003ccode\u003eGetOperation\u003c/code\u003e method until completion and then retrieve results using \u003ccode\u003eListBatchJobResults\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Batch Processing for Performance Max\n\n[Batch processing](/google-ads/api/docs/batch-processing/overview) provides a way to dispatch\na set of operations, which may be interdependent, to multiple services without\nsynchronously waiting for the operations to complete. You can use batch\nprocessing to create and manage Performance Max campaigns.\n\nThis guide provides details specific to Performance Max campaigns when working\nwith batch processing. The generic\n[batch processing guide](/google-ads/api/docs/batch-processing/overview) provides general\ninformation about batch processing, and the\n[Structure requests guide](/google-ads/api/performance-max/structure-requests) contains detailed\ninformation about constructing requests to create or manage Performance Max\ncampaigns.\n\nTo create a Performance Max campaign using batch processing, follow these steps:\n\nCreate a new batch job\n----------------------\n\nFollow the general batch processing\n[job creation step](/google-ads/api/docs/batch-processing/flow#createjob) for creating a\n[`BatchJob`](/google-ads/api/reference/rpc/v21/BatchJob) resource.\n\nPrepare a list of mutate operations\n-----------------------------------\n\nPerformance Max campaigns require operations to create several related\nresources, which are detailed in the\n[Structure requests guide](/google-ads/api/performance-max/structure-requests). Create a\n[`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation) for each resource that should\nbe included in the batch job.\n\n### `CampaignOperation` and `CampaignAssetOperation` requirements\n\n| **Note:** this requirement only applies to [`Campaign`](/google-ads/api/reference/rpc/v21/Campaign) resources with associated [`Asset`](/google-ads/api/reference/rpc/v21/Asset) resources using [`CampaignAsset`](/google-ads/api/reference/rpc/v21/CampaignAsset) in order to meet the [brand asset requirements](/google-ads/api/performance-max/create-campaign#brand-guidelines).\n\nWhen brand guidelines are enabled for a campaign (see\n[brand guidelines](/google-ads/api/performance-max/create-campaign#brand-guidelines)), you must link\nbrand assets to the campaign using [`CampaignAsset`](/google-ads/api/reference/rpc/v21/CampaignAsset)\nresources. Furthermore, in a batch job the creation of these `CampaignAsset`\nresources must happen immediately after the creation of the [`Campaign`](/google-ads/api/reference/rpc/v21/Campaign)\nresource itself. If the `CampaignAsset` resources are not created immediately\nafter the `Campaign` resource (when brand guidelines are enabled - see\n[troubleshooting](/google-ads/api/performance-max/troubleshooting#campaigns_with_brand_guidelines_enabled)),\nthe request will fail and return a `CampaignError` indicating missing assets.\nIncluding the `CampaignAsset` creation operations later in the same list of\noperations won't prevent this error.\n\n### `AssetGroupOperation` and `AssetGroupAssetOperation` requirements\n\n| **Note:** this requirement only applies to [`AssetGroup`](/google-ads/api/reference/rpc/v21/AssetGroup) resources with associated [`Asset`](/google-ads/api/reference/rpc/v21/Asset) resources using [`AssetGroupAsset`](/google-ads/api/reference/rpc/v21/AssetGroupAsset) in order to adhere to the [minimum asset requirements](/google-ads/api/performance-max/asset-requirements).\n\nThe operations of type [`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation) that\ncreate [`AssetGroup`](/google-ads/api/reference/rpc/v21/AssetGroup) and\n[`AssetGroupAsset`](/google-ads/api/reference/rpc/v21/AssetGroupAsset) resources in a batch job must\nbe sequential without other operations in between because of how these\noperations are grouped together when processed. Otherwise, the request throws an\n[`AssetGroupError` indicating some assets are missing](/google-ads/api/performance-max/troubleshooting#common_asset_group_errors),\neven if the operations required to\n[meet minimum asset requirements](/google-ads/api/performance-max/asset-requirements) are included later\nin the operations list.\n\n### `AssetGroupListingGroupFilterOperation` best practices\n\n| **Note:** [`AssetGroupListingGroupFilter`](/google-ads/api/reference/rpc/v21/AssetGroupListingGroupFilter) resources may only be used with Performance Max campaigns for [online sales with a product feed](/google-ads/api/performance-max/retail). [`AssetGroup`](/google-ads/api/reference/rpc/v21/AssetGroup) resources in such campaigns must have a [valid product group tree](/google-ads/api/performance-max/listing-groups) composed of one or more [`AssetGroupListingGroupFilter`](/google-ads/api/reference/rpc/v21/AssetGroupListingGroupFilter) resources associated with it. To target all products, use a single node tree.\n\nWhen working with listing group filters in the context of an\n[`AssetGroupListingGroupFilter`](/google-ads/api/reference/rpc/v21/AssetGroupListingGroupFilter), we\nrecommend adding\n[`AssetGroupListingGroupFilterOperation`](/google-ads/api/reference/rpc/v21/AssetGroupListingGroupFilterOperation)\noperations targeting the same [`AssetGroup`](/google-ads/api/reference/rpc/v21/AssetGroup) to a\nbatch job consecutively, so that the set of operations are treated atomically\nduring batch splitting. To read more on batch splitting and other factors\naffecting listing groups, see the\n[listing group batch processing guide](/google-ads/api/docs/batch-processing/listing-groups).\n\nAdd the mutate operations to the job\n------------------------------------\n\nAdd the mutate operations from [Step 2](#prepareoperations) to a list and call\n[`AddBatchJobOperations`](/google-ads/api/reference/rpc/v21/BatchJobService#addbatchjoboperations)\nto add the list of mutations to the batch job created in [Step 1](#createjob).\nFollow the [add operations step](/google-ads/api/docs/batch-processing/flow#addoperations)\nin the general batch processing guide to add the list of mutate operations.\n\nRun the batch job\n-----------------\n\nAllow the uploaded jobs to start running by calling\n[`RunBatchJob`](/google-ads/api/reference/rpc/v21/BatchJobService#runbatchjob). See\n[Run the batch job](/google-ads/api/docs/batch-processing/flow#runjob)\nstep in the general batch processing guide for an example.\n\nRetrieve the job's status\n-------------------------\n\nBatch jobs start as long-running operations and usually take time to finish.\nAfter starting the job, use the long-running operation's\n[`GetOperation`](/google-ads/api/reference/rpc/google.longrunning#google.longrunning.Operations.GetOperation)\nmethod to [poll the job's status](/google-ads/api/docs/batch-processing/flow#pollstatus)\nuntil it's done.\n\nWhen all of your batch jobs finish, call\n[`ListBatchJobResults`](/google-ads/api/reference/rpc/v21/BatchJobService#listbatchjobresults) to\nprint their statuses and responses following the\n[list all batch job results](/google-ads/api/docs/batch-processing/flow#listresults) step in\nthe general batch processing guide."]]