Zero spend alert
****** THIS SCRIPT IS NOT COMPLETE ****** This script is designed to monitor Google Ads campaigns (that are enabled) for any that have not incurred any expenses on the previous day. It starts by determining yesterday's date relative to the current date and formats this date in a specific string format suitable for querying Google Ads. It then retrieves all enabled campaigns for that date range, which, in this case, is just the single day (yesterday). For each campaign, it checks the advertising spend; if a campaign had zero spend, its name is added to a list of no-spend campaigns. If there are any campaigns in this list by the end of the script, it constructs an email notification. This notification includes a subject line indicating it's an alert for Google Ads campaigns with zero spend, and the message body lists the names of all campaigns that had no spend on the previous day. The email is then sent to one or more specified recipients, alerting them to these no-spend campaigns. The script can be customized to send the notification to multiple email recipients either by including them all in a single email or by sending separate emails to each.
To set up this script, follow these steps:
Open your Google Ads account.
Go to the "Tools & Settings" menu and select "Scripts".
Click the "Create" or "+" button to create a new script.
Copy and paste the following script.
Add the emails you'd like to recieve an alert.
Save the script.
Review and authorize the script to access your Google Ads and Google Sheets accounts.
Run the script manually for the first time to populate the initial values in the spreadsheet.
(Optional) Schedule the script to run on a specific cadence (ie: daily, weekly, monthly, etc.)
Note: Ensure that you have the necessary permissions to access and modify the target Google Spreadsheet.
Last updated