Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của Google Ads trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
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.
Mặc dù hầu hết các dịch vụ đều cung cấp API đồng bộ yêu cầu bạn đưa ra yêu cầu rồi chờ phản hồi, nhưng BatchJobService cung cấp một cách để thực hiện hàng loạt thao tác trên nhiều dịch vụ mà không cần chờ các thao tác hoàn tất một cách đồng bộ.
Không giống như các thao tác biến đổi dành riêng cho dịch vụ, một công việc duy nhất trong BatchJobService có thể hoạt động dựa trên một tập hợp hỗn hợp gồm các chiến dịch, nhóm quảng cáo, quảng cáo, tiêu chí, nhãn và mục trong nguồn cấp dữ liệu.
Các công việc đã gửi sẽ chạy song song và BatchJobService sẽ tự động thử lại các thao tác không thành công do lỗi tạm thời, chẳng hạn như lỗi giới hạn tốc độ. API Google Ads vẫn tính mỗi thao tác vào giới hạn thao tác hằng ngày của bạn, theo hướng dẫn đếm thao tác API.
BatchJobService cũng cho phép bạn sử dụng mã nhận dạng tạm thời trong các yêu cầu để bạn có thể gửi các thao tác phụ thuộc trong một công việc duy nhất.
Hoạt động tính toán
BatchJobService hỗ trợ tất cả các thao tác được liệt kê trong MutateOperation, với một số trường hợp ngoại lệ quan trọng.
Vì API Google Ads thực thi tất cả các thao tác trong một công việc khi thất bại một phần được bật, nên nếu một công việc bị huỷ hoặc các thao tác riêng lẻ không thành công, thì các thao tác đã thành công sẽ không được khôi phục.
Các thao tác sau trong MutateOperation phải là nguyên tử, do đó, không hỗ trợ lỗi một phần và không được hỗ trợ trong các tác vụ hàng loạt. Tránh thêm các thao tác này vào các công việc của bạn, đặt partial_failure thành false trong các yêu cầu và sử dụng phương thức mutate trong GoogleAdsService.
Các thao tác không được hỗ trợ trong BatchJobService
[null,null,["Cập nhật lần gần đây nhất: 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eBatchJobService\u003c/code\u003e enables asynchronous execution of multiple operations across various Google Ads services, reducing the need for synchronous waiting.\u003c/p\u003e\n"],["\u003cp\u003eIt supports a wide range of operations, allowing you to manage campaigns, ad groups, ads, criteria, labels, and feed items within a single job.\u003c/p\u003e\n"],["\u003cp\u003eFailed operations due to transient errors like rate limits are automatically retried, ensuring higher reliability.\u003c/p\u003e\n"],["\u003cp\u003eAlthough it minimizes API requests and retries failed operations, using \u003ccode\u003eBatchJobService\u003c/code\u003e does not inherently guarantee improved performance; experimentation is crucial to determine its suitability for specific use cases.\u003c/p\u003e\n"],["\u003cp\u003eCertain atomic operations like \u003ccode\u003eCampaignConversionGoalOperation\u003c/code\u003e, \u003ccode\u003eConversionGoalCampaignConfigOperation\u003c/code\u003e, \u003ccode\u003eCustomConversionGoalOperation\u003c/code\u003e, \u003ccode\u003eCustomerConversionGoalOperation\u003c/code\u003e, and \u003ccode\u003eCustomerOperation\u003c/code\u003e are not supported in batch jobs and should be executed using \u003ccode\u003eGoogleAdsService\u003c/code\u003e instead.\u003c/p\u003e\n"]]],[],null,["# Batch Processing\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhile most services provide synchronous APIs that require you to make a request\nand then wait for a response, [`BatchJobService`](/google-ads/api/reference/rpc/v21/BatchJobService)\nprovides a way to perform batches of operations on multiple services without\nsynchronously waiting for the operations to complete.\n\nUnlike service-specific mutate operations, a single job in\n[`BatchJobService`](/google-ads/api/reference/rpc/v21/BatchJobService) can operate against a mixed\ncollection of campaigns, ad groups, ads, criteria, labels, and feed items.\nSubmitted jobs run in parallel, and\n[`BatchJobService`](/google-ads/api/reference/rpc/v21/BatchJobService) automatically retries\noperations that fail due to transient errors such as rate limit errors. The\nGoogle Ads API still counts each operation towards your\n[daily operation limit](/google-ads/api/docs/access-levels#access-levels), following the\n[API operations](/google-ads/api/docs/rate-sheet#api-operations) counting instructions.\n\n[`BatchJobService`](/google-ads/api/reference/rpc/v21/BatchJobService) also lets you use\n[temporary IDs](/google-ads/api/docs/batch-processing/temporary-ids) within your requests so\nyou can submit dependent operations in a single job.\n| **Note:** Use of [`BatchJobService`](/google-ads/api/reference/rpc/v21/BatchJobService) can reduce the number of requests sent but its use must be evaluated to see if it's a good fit for your needs. The main reasons for using batch processing are to minimize the number of API requests and retry operations that fail due to transient errors. This doesn't guarantee improved performance resulting in higher throughput or quicker job completion. Experiment with different combinations of batch and non-batch processing to determine the optimal solution for your circumstances.\n\nOperations\n----------\n\n`BatchJobService` supports all of the operations listed in\n[`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation), with a few important\nexceptions.\n\nBecause the Google Ads API executes all operations in a job with\n[partial failure](/google-ads/api/docs/best-practices/partial-failures) enabled, if a job is\ncancelled or individual operations fail, operations that succeeded will *not*\nbe rolled back.\n\nThe following operations in `MutateOperation` must be\n[atomic](/google-ads/api/docs/mutating/bulk-mutate), and thus, don't support partial failure\nand are *not* supported within batch jobs. Avoid adding these operations to your\njobs, set `partial_failure` to `false` in your requests, and use the `mutate`\nmethod in [`GoogleAdsService`](/google-ads/api/reference/rpc/v21/GoogleAdsService) instead.\n\n#### Unsupported operations in BatchJobService\n\n- [`CampaignConversionGoalOperation`](/google-ads/api/reference/rpc/v21/CampaignConversionGoalOperation)\n- [`ConversionGoalCampaignConfigOperation`](/google-ads/api/reference/rpc/v21/ConversionGoalCampaignConfigOperation)\n- [`CustomConversionGoalOperation`](/google-ads/api/reference/rpc/v21/CustomConversionGoalOperation)\n- [`CustomerConversionGoalOperation`](/google-ads/api/reference/rpc/v21/CustomerConversionGoalOperation)\n- [`CustomerOperation`](/google-ads/api/reference/rpc/v21/CustomerOperation)"]]