Promotion Ad Customizer
Manages ad customizer attributes based on a Google Sheets promotion schedule. Automatically creates customizer attributes and assigns promo text to Search campaigns based on labels, brand name matching, and date ranges.
by Dmytro Tonkikh, chiliad·gist.github.com/tonkikh/49425aba1a223fdc24159150d9ad1832
Overview
Define promotions in a Google Sheet with start/end dates, target labels, and brand filters — the script creates customizer attributes automatically and assigns the promo text to matching Search campaigns (used in ads as {CUSTOMIZER.<name>}). It reconciles each run: customizers on campaigns that no longer match (or whose text changed) are removed. MCC accounts are handled automatically by the loader. Runs in preview by default.
Setup
- 1Make a copy of the template Google Sheet: https://docs.google.com/spreadsheets/d/1Jc08mG0IhmBjH_POHo-kVzwcRmGcY785lmGc76x9rAY/
- 2Fill in the "promo" tab: customizer, text, enabled, start date, end date, label, brand (one row per promotion).
- 3Set SPREADSHEET_URL to your copied sheet's URL.
- 4Preview the script (DRY_RUN = true) to see the planned changes in the logs.
- 5Set DRY_RUN = false and schedule daily (or more often during active promos).
Configuration Variables
| Variable | Default |
|---|---|
SPREADSHEET_URL | "" |
DRY_RUN | true |
Expected Output
=== Promotion Ad Customizer === Assignments: 36 | removals: 4 | new attributes: 1 [DRY RUN] 41 operation(s) planned. Set DRY_RUN = false to apply.
Notes
The "promo" tab needs columns: customizer, text, enabled, start date, end date, label, brand. Brand matching is a case-insensitive regex — separate multiple brands with "|"; labels are also "|"-separated for multi-label targeting. Branded promotions take priority over Global (no label/brand) ones for the same campaign. Only ENABLED Search campaigns are targeted. Missing customizer attributes are created automatically.