Để 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.
Trang này trình bày các giới hạn và hạn chế khác nhau trong tập lệnh Google Ads mà bạn cần lưu ý. Các giới hạn này có thể thay đổi bất cứ lúc nào mà không cần cảnh báo, vì vậy, hãy đảm bảo rằng tập lệnh của bạn linh hoạt và có chứa tính năng xử lý lỗi.
Giới hạn thời gian thực thi
tập lệnh Google Ads
Các tập lệnh Google Ads cho tài khoản nhà quảng cáo có thể thực thi trong tối đa 30 phút, sau đó sẽ bị huỷ. Tất cả các thay đổi được thực hiện trước khi tập lệnh bị huỷ sẽ được áp dụng.
Tập lệnh Ad Manager
Các tập lệnh Ad Manager thường có thể thực thi trong tối đa 30 phút, sau đó sẽ bị huỷ. Tuy nhiên, nếu một tập lệnh Trình quản lý quảng cáo sử dụng phương thức executeInParallel để xử lý song song các tài khoản và chỉ định một phương thức gọi lại, thì tập lệnh đó có thể thực thi tối đa 60 phút trước khi bị huỷ. Điều này được minh hoạ trong hình sau, trong đó processAccount là hàm song song và allFinished là phương thức gọi lại khi gọi executeInParallel.
Tất cả các thay đổi được thực hiện trước khi tập lệnh bị huỷ sẽ được áp dụng.
Giới hạn về thực thể
Tập lệnh của tài khoản Google Ads
Một trình lặp duy nhất sẽ mặc định trả về tối đa 50.000 kết quả. Bạn có thể sửa đổi việc này bằng cách gọi withLimit() trên bộ chọn.
Một bộ chọn có thể xử lý tối đa 10.000 mã nhận dạng trong selector.withIds().
Nếu bạn chỉ định từ 10.000 mã nhận dạng trở lên, selector.get() sẽ gửi lỗi thời gian chạy. Tương tự, việc chỉ định điều kiện Id IN [LIST] bằng một danh sách mã nhận dạng
10.000 sẽ dẫn đến lỗi thời gian chạy.
Thông tin nhật ký đưa ra sẽ bị cắt bớt ở mức 100 Kb. Cảnh báo sẽ được ghi lại nếu điều đó xảy ra.
Tập lệnh của tài khoản người quản lý
Mỗi tài khoản được xử lý bằng một tập lệnh Ads Manager sẽ có hạn mức riêng như được liệt kê ở trên.
Khi sử dụng phương thức executeInParallel, một tập lệnh có thể xử lý tối đa 50 tài khoản.
Phương thức processAccount từ executeInParallel có thể trả về tối đa 10 MB dữ liệu.
Giới hạn tải lên hàng loạt
Tệp tải lên có giới hạn là 50 MB và 1 triệu hàng. Tệp sẽ bị từ chối khi gửi nếu vượt quá các giới hạn này.
Một lệnh tải lên sẽ hết thời gian chờ sau 2 giờ và lệnh này sẽ ngừng xử lý mọi dữ liệu còn lại trong tệp được tải lên.
Hạn mức cho các dịch vụ của Google
Các dịch vụ Google Apps Script cơ bản áp đặt hạn mức hằng ngày và giới hạn cố định đối với một số tính năng. Xem danh sách hạn mức và thông báo ngoại lệ đi kèm.
Tập lệnh được uỷ quyền
OAuth2 được dùng để uỷ quyền cho tập lệnh. Mỗi tài khoản có giới hạn 250 tập lệnh được uỷ quyền. Nếu vượt quá hạn mức đó, một trong các tập lệnh đã được uỷ quyền trước đó sẽ bị huỷ uỷ quyền. Đây chỉ là lỗi tạm thời và tập lệnh có thể được uỷ quyền lại vào lần tiếp theo mở tập lệnh.
Nếu thường xuyên gặp phải giới hạn này, bạn nên cân nhắc sử dụng nhiều tài khoản người dùng để uỷ quyền cho các nhóm tập lệnh khác nhau.
Chiến dịch Video và chiến dịch Mua sắm
Bộ chọn chiến dịch chuẩn (AdsApp.campaigns().get()) sẽ lọc ra các chiến dịch video và mua sắm khỏi kết quả. Thay vào đó, hãy sử dụng bộ chọn chiến dịch chuyên dụng:
[null,null,["Cập nhật lần gần đây nhất: 2025-08-27 UTC."],[[["\u003cp\u003eGoogle Ads scripts have an execution time limit of 30 minutes, while Ads Manager scripts can run for up to 60 minutes when using \u003ccode\u003eexecuteInParallel\u003c/code\u003e with a callback method.\u003c/p\u003e\n"],["\u003cp\u003eScripts for advertiser accounts have entity limits, including a 50,000 result limit per iterator, a 10,000 ID limit per selector, and a 100Kb logging output limit.\u003c/p\u003e\n"],["\u003cp\u003eAds Manager scripts have additional limits for processing accounts in parallel, with a maximum of 50 accounts and a 10MB data return limit for the \u003ccode\u003eprocessAccount\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eBulk uploads are restricted to files under 50MB and one million rows, with a two-hour timeout for processing.\u003c/p\u003e\n"],["\u003cp\u003eEach Google Ads account can authorize up to 250 scripts, and exceeding this limit will temporarily deauthorize older scripts.\u003c/p\u003e\n"]]],[],null,["# Limits\n\nThis page outlines various limits and limitations in Google Ads scripts that you\nshould be aware of. These limits can change at any time without warning, so\nensure that your scripts are flexible and contain error handling.\n\nExecution time limits\n---------------------\n\n### Google Ads scripts\n\nGoogle Ads scripts for advertiser accounts can execute for a **maximum of 30\nminutes**, after which they will be cancelled. All of the changes made\nbefore the script was cancelled will be applied.\n\n### Ads Manager scripts\n\nAds Manager scripts can normally execute for a **maximum of 30 minutes** after\nwhich they will be cancelled. However, if an Ads Manager script uses the\n[`executeInParallel`](/google-ads/scripts/docs/reference/adsmanagerapp/adsmanagerapp_managedaccountselector#executeInParallel_2)\nmethod to process accounts in parallel, and specifies a callback method, then it\ncan execute up to a **maximum of 60 minutes** before being cancelled. This is\nillustrated in the following figure, where `processAccount` is the parallel\nfunction, and `allFinished` is the callback method when calling\n[`executeInParallel`](/google-ads/scripts/docs/reference/adsmanagerapp/adsmanagerapp_managedaccountselector#executeInParallel_2).\n\nAll of the changes made before the script was cancelled will be applied.\n\nEntity limits\n-------------\n\n| **Note:** [Reports](/google-ads/scripts/docs/features/reports) are not subject to any entity limits.\n\n### Scripts of Google Ads accounts\n\n- A single **iterator** will default to at most 50,000 results returned. You\n can modify this by calling `withLimit()` on the selector.\n\n- A single **selector** can handle at most 10,000 IDs in `selector.withIds()`.\n If 10,000 or more IDs are specified, `selector.get()` will throw a runtime\n error. Similarly, specifying an `Id IN [LIST]` condition with a list of IDs\n\n \u003e 10,000 will result in a runtime error.\n- Logging output will be truncated at 100Kb. A warning will be logged if that\n happens.\n\n### Scripts of manager accounts\n\n- Each account processed by an Ads Manager script gets its own quota as [listed\n above](#scripts_of_google_ads_accounts).\n\n- When using the `executeInParallel` method, a script can process up to **50**\n accounts.\n\n- The `processAccount` method from `executeInParallel` can return up to\n **10MB** of data.\n\nBulk upload limits\n------------------\n\n- The upload file is limited to 50MB and one million rows, and will be rejected\n upon submission if it exceeds these limits.\n\n- An upload job times out after two hours and the job will stop processing any\n remaining data from the uploaded file.\n\nQuotas for Google services\n--------------------------\n\nThe underlying Google Apps Script services impose daily quotas and hard limits\non some features. See a list of these\n[quotas and accompanying exception messages](/apps-script/guides/services/quotas).\n| **Key Point:** To get around the \"Exceeded maximum execution time\" error, you can reschedule your script under multiple user accounts to extend the script's quota.\n\nAuthorized scripts\n------------------\n\nOAuth2 is used to authorize scripts. Each account has a limit of **250**\nauthorized scripts. Beyond that limit, one of the previously authorized\nscripts will be deauthorized. This is only temporary, and the script can be\nreauthorized the next time it is opened.\n\nIf you are frequently running into this limit, you should consider using\nmultiple user accounts to authorize different sets of scripts.\n\nVideo and shopping campaigns\n----------------------------\n\nThe standard campaign selector (`AdsApp.campaigns().get()`) will filter\nout [video](//support.google.com/google-ads/answer/2375497) and\n[shopping](//support.google.com/google-ads/answer/3455481) campaigns\nfrom the results. Use the dedicated campaign selectors instead:\n\n- [`videoCampaignSelector.get()`](/google-ads/scripts/docs/reference/adsapp/adsapp_videocampaignselector)\n- [`shoppingCampaignSelector.get()`](/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingcampaignselector)"]]