How to get alerts when a Google Ads script fails
Google Ads does not notify you about failed scripts. Here is how to get told by email, in Slack and in the app.
Google Ads records failed runs in the script history and leaves it at that. Unless you open the page, you do not know.
The do-it-yourself way
Wrap the script's work in try / catch and email yourself the error:
function main() {
try {
run();
} catch (e) {
MailApp.sendEmail("you@example.com", "Script failed", String(e));
throw e;
}
}This helps with errors inside the code. It cannot tell you about a script that never started, lost its authorization or was cut off at the time limit, because in those cases your code is not running.
Alerts in chiliad
Scripts deployed through the chiliad loader report every run. On paid plans chiliad raises an alert when a script:
- fails three times in a row,
- stops running for much longer than its frequency allows,
- finishes far faster than usual, which usually means it exits early.
Alerts are sent by email, shown in the app, and posted to Slack if a webhook is configured. They include the script, the number of failures and the latest error message. While a problem persists, alerts repeat at most every few hours rather than on every run.
Setting it up
- Deploy the script with its loader; reporting is built in.
- Set the script's Frequency in chiliad to match its schedule in Google Ads.
- Set Priority to High for scripts that must not fail, so their alerts are marked critical.
- Choose your notifications in Settings β Notifications and add a Slack webhook for the team.
After an alert, open the script's History tab for the failed runs and their messages.
- 1
The alert names the script and the problem.
- 2
The latest error message, so you often know the cause before opening chiliad.
- 3
View Script opens the script in chiliad.