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.letamount=999999999999;campaign.getBudget().setAmount(amount);// Error is logged into Changes log, but the script keeps running.// Suppose we must know whether the change actually happened.if(campaign.getBudget()!=amount){// The current value of budget is not the one we expected.// The change must have failed.}
Operations that output similar errors include:
Setting a keyword bid larger than the campaign budget.
Setting a campaign name to one that already exists.
Creating an ad group in a campaign that has already reached its quota for ad
groups.
Some errors, however, cannot be ignored. Here is an example:
With this code, the script cannot produce a meaningful keywords iterator
since the date range is not specified. Thus the script execution will halt, and
an error message logged to the text logs.
Warnings are logged by the script if
quotas are exceeded. The script
execution will still proceed, but you should always review warnings.
Errors are red and warnings are orange in execution logs. You can also output
custom messages
to these logs for troubleshooting and monitoring purposes.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[[["Google Ads scripts will log errors when changes fail but continue running, allowing you to check if a change was successful and handle it accordingly."],["Certain errors, such as missing required parameters, will halt script execution and require fixing before the script can run."],["While scripts proceed even when exceeding quotas, warnings are logged and should be reviewed."],["Script execution logs provide valuable information through errors (red), warnings (orange), and custom messages for debugging and monitoring."],["Successfully returned objects from Google Ads scripts are safe to use, indicating the operation was successful."]]],[]]