How to run one Google Ads script on multiple accounts
Running a script across client accounts from a manager account, with executeInParallel or a chiliad loader.
To run the same script in many accounts without pasting it into each one, run it from a manager (MCC) account.
The native way
A manager-level script selects accounts and runs a function in each of them:
function main() {
AdsManagerApp.accounts()
.withCondition("customer_client.descriptive_name CONTAINS 'Retail'")
.executeInParallel("processAccount");
}
function processAccount() {
var account = AdsApp.currentAccount();
Logger.log("Working on " + account.getName());
// the same logic you would run in a single account
}Inside processAccount, AdsApp refers to the client account being processed. Up to 50 accounts run in parallel per execution.
What this leaves you to solve: which accounts to include, where to keep each client's settings, and how to know which accounts failed.
With chiliad
You write the script as if for a single account β a main() function and settings as variables. chiliad handles the rest:
- Assign the script to the client accounts that should run it.
- Set values per account where they differ from the default.
- Paste one loader into the manager account and schedule it.
On each run the loader asks chiliad for the assigned accounts and runs the script in those, in parallel, with each account's own values. Add or remove a client in chiliad and the next run follows; the loader does not change.
If no accounts are assigned, the run is skipped rather than running everywhere.
Good practice
- Test on one or two accounts before assigning all of them.
- Give variables sensible defaults so new accounts work without extra setup.
- Check the run history after the first scheduled run: a result such as 3/5 means two accounts need attention.
- 1
Three steps: assign accounts, set values, copy the loader.
- 2
Tick the accounts that should run this script.
- 3
Assign & Continue saves the assignment and moves on to the values table.