Budgeting

Campaign Spending Alert Script

Why should you use “Campaign Spending Alert Script”?

Do you know what could happen if you don't keep an eye on your campaign spending? 

You might end up overspending and wasting your budget, which could seriously harm the success of your advertising campaigns. Also, manually monitoring your spending can be quite a hassle and distract you from other important work.

Using the Campaign Spending Alert Script can help you keep track of your campaign spending and receive automatic alerts when your budget is reaching its limit, thus preventing overspending and saving time.

How does the script work?

This script is designed to monitor your account and detect any unusual spending behavior by analyzing changes in your spending patterns. It compares the average spend of your campaigns during a chosen time period to the spend on the current day and sends an alert email if the spend is higher or lower than your chosen percentage change threshold.

You have the flexibility to customize the script by selecting the time period (the default is a week) that will be used to calculate the historic spending average. You can also set the time of day when the script will start collecting data to trigger alerts. Additionally, you can set a minimum spend value to avoid being alerted about small changes in campaigns that have historically low spending.

Before setting up the script, get familiar with the  interface and navigation in Google ads

  1. Tools- The Tools tab provides direct links to various Google Ads account tools. Use these tools to monitor and make changes to your account, ads, ad groups, and keywords.
  2. Bulk actions- It allows advertisers to modify multiple campaigns, ad groups, ads, or keywords in a single action, saving time and effort.
  3. Scripts- It allows advertisers to automate and customize their bulk actions. This tool allows advertisers to create custom scripts that perform specific actions on their campaigns or accounts, such as updating bids, pausing underperforming ads, or adding new keywords.
  4. + button- It allows advertisers to create new scripts. 

  1. New Script- It allows advertisers to create a new script from scratch.

  1. Add Script Name- It allows advertisers to name their scripts. 
  2. Authorize-  It allows advertisers to grant permission for their script to access their Google Ads account.
  3. Save- It allows advertisers to save their scripts after making changes or creating new ones.

  1. Frequency- It allows advertisers to set how often a script runs.
  2. Script - Given script name is  Campaign Spending Alert Script.

  1. Run- It allows advertisers to execute a script.

  1. Logs- The log statement in Google Ads Script Tools is used to output messages to the script's log, helping advertisers track progress, troubleshoot issues, and create custom reports.

Steps to add the Campaign Spending Alert Script in Google Ads:

Step-1 Log in to your Google Ads account and navigate to the "Bulk Actions" tab.

Step-2 Choose "Scripts" from the drop-down menu.

Step-3 Click on the "Add" button to create a new script.

Step-4 Copy and paste the Campaign Spending Alert Script. 

  • Don’t forget to fill in the variables at the top of the script with your preferences and details, including the email addresses you want to receive alerts.
  • Use the campaignNameContains and campaignNameDoesNotContain filters to include or exclude campaigns from the script data.
  • Leave [  ] blank to include all campaigns.
  • Set the percentageDifferenceSpend threshold to determine when alerts should be sent.    
  • This number must be positive and above zero.
  • Use the averageSpendMinimumThreshold setting to ignore changes in spending for historically low-spending campaigns.
  • This threshold is an absolute amount in your account's currency and must be greater than zero.
  • This means you won't receive alerts for small changes in spending for campaigns with an average historic spend under this threshold, even if they start spending again.

  •  Set the earliest hour to the time you want the script to run on to avoid small changes in spending in the morning.
  • There is also one advanced setting: adjust the timePeriod setting to change the number of days used to get the average historical spending data.

Step-5 Next, click the "Authorize" button to authorize the script to access your account.

Step-6 Click on the "Save."

Step-7 Go back to the "Scripts" section and find the " Campaign Spending Alert Script" script at the top of the list. 

Step-8 Then, set the frequency at which you want the script to run (e.g., daily, weekly, or monthly).

Step-9 Then click on Campaign Spending Alert Script.

Step-10 “Run the script.”

Step-11 Once the script has finished running, click on the "Logs" button to see the results. 

The logs will show you the date and time the script ran, any errors that occurred, and any email alerts that were sent.

Note: The script only looks at currently enabled campaigns, and you can use multiple copies of the script to monitor different campaigns.


Free website audit image

Get your free website Audit

Run an instant, highly detailed audit of your entire website. Identify over 200 common issues based on priority and importance, and find out how to fix them.

Check Now

Get your Script

Download your script

Download
Oops! Something went wrong while submitting the form.