This is the legacy documentation for Google Ads scripts. Go to the current docs.

Errors and Warnings

Stay organized with collections Save and categorize content based on your preferences.

Google Ads scripts execute in best-effort fashion: They attempt to make changes to Google Ads data, but if a certain change is not successful, the script records it into Changes log and proceeds with the execution:

// Attempt an invalid change.
// Error is logged into Changes log, but the script keeps running.

// Suppose we must know whether the change actually happened.
if (campaign.getBudget() != -100) {
  // The current value of budget is not the one we expected.
  // The change must have failed.

Other errors, however, cannot be skimmed over:

var keywords = AdsApp.keywords()
    .withCondition("Clicks > 10")
    // Forgot forDateRange().

With the above code, the script cannot produce a meaningful keywords iterator, since the date range was not specified. The script execution will halt, and an error message will be logged to the text logs.

Rule of thumb: When Google Ads scripts hands you an object, it is safe to work with; an error would occur if fetching of an object failed. When you request an invalid change, the failure will be logged, but the execution will proceed.

Warnings are logged by the script when one of the quotas has been exceeded. The script execution will proceed, but you're advised to carefully review all warnings.

The following screenshot shows how warnings and errors are presented in the user interface: