How to use different script settings for each account
Keep one Google Ads script but give every client account its own budget, threshold, email or spreadsheet.
The same script rarely fits every client unchanged. One has a 5,000 budget, another 40,000; alerts go to different people; reports go to different sheets. The usual workarounds β a copy of the script per client, or a big lookup table inside the code β are hard to maintain.
Separate the settings from the code
Write the script with its settings as variables at the top:
var MONTHLY_BUDGET = 5000;
var ALERT_EMAIL = "you@example.com";
var SHEET_URL = "";
function main() {
// use MONTHLY_BUDGET, ALERT_EMAIL and SHEET_URL here
}The values in the code are the defaults.
Declare the variables
On the script's Variables tab, chiliad lists the settings it detected in your code. Add them, choose a type for each β text, number, boolean, URL or JSON β and save.
Set values per account
On the Accounts tab switch to Configure. You get a table with one row per assigned account and one column per variable.
- Leave a cell empty to use the default.
- Type a value to override it for that account.
- A cell marked as missing has neither, and needs a value before the script can work for that account.
Column menus fill a whole column, copy values from another account or clear all overrides.
What happens at run time
The loader fetches the account's values together with the code and applies them before the script starts. Changes take effect on the next run, with no changes in Google Ads. Every change is recorded under Config changes, with who made it and when.
- 1
The legend explains the three cell states.
- 2
Override β this account uses its own value.
- 3
Missing β the variable has no default and no value for this account, so the script would run with an empty setting.
- 4
Save changes takes effect on each account's next run. The loader in Google Ads does not change.