Scripts and deployment
Create and edit scripts, keep version history, set per-account values and deploy to Google Ads with a single loader.
A script in chiliad has two parts: the code, hosted and versioned by chiliad, and a small loader that you paste into Google Ads once. The loader fetches the current code and settings on every run, so you never edit scripts inside Google Ads again.
Your script library
Scripts lists every script in the workspace with its status, last run and success rate.
- 1
Create Script β start blank or from a template. Marketplace installs land in this list too.
- 2
Status shows health at a glance: Active, Error when recent runs failed, Not configured when no accounts are assigned yet.
- 3
Update available marks a marketplace script whose original has a newer version.
Writing and editing code
Open a script to edit it. The editor highlights JavaScript, underlines syntax errors as you type and autocompletes Google Ads objects such as AdsApp. and SpreadsheetApp..
Code needs a function main() entry point. Put settings in top-level var declarations with UPPER_SNAKE_CASE names so they can become variables.
Save with the button or Cmd+S / Ctrl+S. Saving is blocked while the code has syntax errors.
- 1
Tabs for the code, variables, version history, execution history and assigned accounts.
- 2
Switch between your Script Code, the Loader to paste into Google Ads, and the Analytics snippet.
- 3
Save publishes immediately: accounts pick up the new code on their next run. The amber dot means unsaved changes.
Version history
Every save creates a version, whoever or whatever made it.
- 1
Each version records the author and the source: the dashboard, Claude, a restore or a marketplace update.
- 2
Compare shows a side-by-side diff against the current code.
- 3
Restore makes an old version current again.
Tip
The same tab lists Config changes: who changed which per-account value, and when.
Script variables
Variables are the settings a script exposes β budgets, thresholds, email addresses, spreadsheet URLs. Declaring them lets you change values per account without touching the code.
- 1
chiliad detects top-level settings in your code and offers to add them as variables.
- 2
Each variable has a type (text, number, boolean, URL or JSON) and a default value that every account uses unless you override it.
- 3
Save variables to make them available in the per-account table.
Assign accounts
The Setup Guide on a new script opens a three-step wizard. Later, manage assignments in the script's Accounts tab.
- 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.
Per-account values
The Configure view of the Accounts tab is a table with one row per account and one column per variable. Fill in only what differs; everything else uses the script default.
- 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.
Tip
Column menus save time on long lists: Fill all withβ¦, Copy from account and Clear all overrides.
Deploy with the loader
The loader is the same snippet for every account that runs the script.
- Copy it from the last step of the wizard, the Loader view of the editor, or Get Loader in the Accounts tab.
- In Google Ads open Tools β Bulk actions β Scripts, add a new script and paste.
- Authorize, run a preview to check the logs, then set the frequency.
From now on, edit code and values only in chiliad.
- 1
Copy or download the loader in chiliad.
- 2
Paste it as a new script in Google Ads β in a client account, or in the manager account to cover many clients at once.
- 3
Authorize once, preview, then schedule. The schedule is always set in Google Ads.
Tip
If a script later starts using another Google service (Sheets, Drive, Gmail), copy the loader again so Google Ads asks for the extra permission.
Running at manager (MCC) level
Pasted into a manager account, the loader asks chiliad which accounts the script is assigned to and runs only those, in parallel. Assigning or unassigning an account in chiliad changes the targeting on the next run; the snippet in Google Ads stays untouched.
- If no accounts are assigned, the run is skipped and the Google Ads log says so. This stops a script from running across a whole manager account by accident.
- If chiliad cannot be reached, the run is skipped as well rather than guessing.
- Scripts that contain their own
AdsManagerApplogic select accounts themselves.