How to Add and Schedule a Google Ads Script
Scripts are added under Tools, Bulk actions, Scripts. Paste the code, authorise it with an account that has edit access, run a preview and read the log, then set the schedule separately in the scripts list.
Scripts live in one place in the interface and the path has changed names more than once. As of now it is Tools → Bulk actions → Scripts. In a manager account the same path exists and produces manager-level scripts, which behave differently.
The five steps
- Open the scripts panel. Tools → Bulk actions → Scripts, then the plus button. You get an empty editor with a
function main() {}stub. - Paste and name it. Replace the stub entirely. Name it something you will recognise in a list of thirty: what it does, not what it is called on this site.
- Authorise. The first save prompts for authorisation. You are granting the script the permissions of the Google account you are signed in as — if that account has edit access, so does the script.
- Preview. Preview executes the script and shows the log without applying changes to the account. Read the whole log. A script that logs nothing has usually returned an empty result set, not succeeded silently.
- Schedule. Frequency is set separately from the script itself, in the scripts list. Hourly, daily at a chosen hour, weekly, or monthly.
Preview suppresses changes to the account, but it does not suppress side effects outside it. A script that sends mail will send mail during a preview. A script that writes to a spreadsheet will write to it. If the script has external effects, comment them out for the first run or gate them behind your own flag.
Choosing the schedule
The instinct is to run everything daily. Resist it, because an alert that fires when nothing is wrong stops being read within two weeks, and after that it is worse than no alert at all.
| Job | Sensible frequency | Why |
|---|---|---|
| Spend and pacing checks | Daily, early | A budget mistake compounds by the hour; you want it before the day is spent |
| Landing page checks | Daily | Pages break without warning and nobody tells the ads account |
| Search term and n-gram analysis | Weekly | Daily volume is too thin to draw a conclusion from |
| Full account audits | Monthly | Structural things change slowly; a monthly diff is readable |
Where the time goes
Scheduled runs execute in the account time zone, not yours, and not at the exact minute you chose — Google runs them within the hour. A daily 07:00 script may run at 07:41. Do not build logic that assumes a precise start time, and never chain two scheduled scripts by assuming one finishes before the other begins.
Account level versus manager level
A script installed on the account touches only that account and is the right default. A manager-level script iterates accounts and is the right choice only when the logic is genuinely identical across them.
The failure mode of manager scripts is a single account with something different about it — another currency, a renamed conversion action, no data at all — throwing an error that stops the loop for everyone downstream. Handle each account in a try block, or use executeInParallel, which isolates failures per account.
Before the first scheduled run
- Change the configuration lines at the top. Most scripts on this site put an email address and one or two thresholds there.
- Run a preview and read the log end to end.
- If the script writes to the account, confirm the dry-run flag is still on for the first scheduled run, and check the log the next morning before turning it off.
- Check the account time zone, because every date calculation in the script depends on it.
Start with a read-only one. The final URL health check writes nothing, fails visibly, and tends to find something on its first run.
Questions
- Where are scripts in the new Google Ads interface?
- Tools, then Bulk actions, then Scripts. The same path exists in manager accounts and creates manager-level scripts instead.
- Does preview send emails?
- Yes. Preview suppresses changes to the account but not external side effects. Mail is sent and spreadsheets are written during a preview run.
- Can I schedule a script to run every fifteen minutes?
- No. Hourly is the shortest interval available. Scheduled runs also start somewhere within the chosen hour rather than at an exact minute.
- Whose permissions does a script run with?
- The Google account that authorised it. If that user loses access to the account, the script stops running until it is reauthorised.