On this page:
This script must be scheduled to run every hour if you want it to re-enable paused items at the start of a new budget period.
Read Settings from Spreadsheet: Select this option to get the values from the spreadsheet. You can copy this sample spreadsheet to set up budgets.
Note: Each column in the spreadsheet has an explanation of how the information has to be entered. The spreadsheet can work across accounts and settings.
Maximum Budget Amount: Enter the budget amount you want to reach before the item is paused. The number in this field applies to each individual item.
Monthly Cycle Start Date: In this field, you can set the month's day that is defined as the cycle start date for the budget period. It should be between 1 and 28.
Actions when Budget is Exceeded
Pause Items: When this setting is set to yes, items that have exceeded the maximum budget amount for the budget period can automatically be paused.
Reenable Items: The script applies a Google Ads label to all items. It pauses and uses the same label to enable those items at the beginning of the budget period.
Email Addresses To Notify: The email addresses of those who should receive notifications when an item exceeds its maximum spend limit, gets paused, or is enabled. Separate multiple email addresses with commas.
Text Of Label To Add: The name of the Google Ads label to add to items that exceed the budget and are paused. This label is used to automatically find these items to reactivate them when the next budget period starts.
By default, the label is "stopped by budget script", and when an entity is labeled by the script, it'll be followed by the budget period from your script settings in parentheses. For example:
stopped by budget script (Daily)
stopped by budget script (Weekly Mon-Sun)
stopped by budget script (Weekly Sun-Sat)
stopped by budget script (Monthly)
stopped by budget script (Custom)
If you are using multiple settings in the same account, we recommend using different labels to avoid confusion.
Check Only Items With This Label: The script will only check the items' budgets with this label. Leave blank to check all active items in your account.
Campaign/Ad Group Name Contains: When you add text in this field, the script will perform actions only on campaigns or ad groups whose names contain that text. For instance, if 3 out of your 10 campaigns have the word "Bath" in their names, the script will monitor and pause those 3 campaigns. The field is not case-sensitive.
Aggregate Costs: When checked, the combined cost of all matching items is compared to the budget. When left unchecked, each item that matches the search criteria is evaluated independently.
The field applies when the item to pause is other than "Account."
Show Debug Data In Logs: Select this option to get the complete logs, which can be useful when reporting a problem to Optmyzr. This option severely decreases the script's performance, so it should be turned off most of the time.
Advanced Option: If you manage many accounts and budgets, it may be easier to maintain your settings in a Google Spreadsheet. Copy this spreadsheet to your own Google account for use with the New Advanced Settings of this script.