Google Ads scripts are beneficial tools that can do a lot of tedious work for you so that you can focus on more creative tasks. We have already posted an article with 10 scripts to prevent Google Ads budget overspending, but there is much more to discover.
In this blog post, let’s look into scripts that can help you control your Google Ads metrics and KPI and notify you if something goes wrong.
Quick Links
Before We Start: An Alternative to Google Ads Anomaly Tracking and Alerting Scripts
1. Account Anomaly Detector Script
2. Get Notified of Google Ads Account Anomalies
3. Goodbye Low Quality Score Script
4. Automatically Pause Ads with Low CTR
6. Pause Suspicious Ads Script
7. Report Campaigns Without Impressions
8. Pause All Keywords With No Impressions
9. Exclude Queries With High CPA
10. Exclude Mobile App Ad Placements That Perform Poorly
11. Pause Underperforming Ads From Your A/B Tests
12. Low Conversions Cleaner for Search, Video, Display, and Shopping
13. Finding Anomalies in Your Keywords, Ad Groups, and Ads
Before We Start: An Alternative to Google Ads Anomaly Tracking and Alerting Scripts
Certainly, scripts are an excellent solution for sophisticated PPC marketers, but if you are not very experienced, all those code lines and variables may be tricky for you. So probably, you should start with more user-friendly tools. For example, we at PromoNavi have developed the Alerting tool that notifies you when something on your account goes wrong.
Let’s see how it works.
Log in or sign up to PromoNavi and select Account alerts from the menu on the left. Then, click Create notifications of important events in accounts.
Select Anomaly Detector.
Anomaly Detector keeps track of metrics in your accounts and campaigns. If it finds any severe differences from the acceptable values, you will receive a notification.
You can start from scratch and create custom alerts, or choose from the presets:
To configure the Anomaly Detector, enter an Alert name, so you can quickly identify your alert later. You also need to choose a currency for your metrics from the drop-down menu.
Also, you need to select the tracking level: you can choose between accounts and campaigns.
Once done, add conditions when your alert should be activated. Click Add a condition, and a pop-up will open.
To add a condition, select a metric. You can choose from metrics, such as Spend, Impressions, Clicks, CPC, CPM, CTR, Conversions, Spend/Conversion, Conversion Rate, Conversion Value, ROAS.
Next, choose the parameters, such as changed by more than; changed less than; increased by more than; decreased less than; increased less than; is more than; is less than. Now, enter a percentage.
You can add several rules by clicking Add “OR” rule.
Click SAVE when you are ready.
Next, set up the Time Range and Frequency. You can choose how often the script should check your account for anomalies: every 6, 12, or 24 hours. Next, choose the time range to compare with: the same day of the last 5 weeks; last week; last 60 days; or the same day a week ago.
During the setup, you can also run a backtest for your triggering conditions on historical data to avoid oversampling in the future.
Add alert channels — email, Telegram, or both — and you are almost done.
Last but not least, check if everything is set up correctly in the Summary section, then click Save and activate, or save this alert as a draft.
That’s it. The system will check selected accounts or campaigns and will notify you if there are any anomalies.
Still want to try out some Google Ads scripts to control your metrics and KPI? Look through the following list of scripts to find the best anomaly detection solution for you.
1. Account Anomaly Detector Script
This script from the Google Ads scripts team sends alerts every time your account behaves too differently from what is historically observed.
Account Anomaly Detector compares stats observed so far today with historical stats for the same day of the week. For example, stats for a Monday, 13:00, will be compared with 26 previous Mondays (you can adjust the number of weeks).
The script will analyze data for such crucial metrics as Impressions, Clicks, Conversions, Cost.
Keep in mind, this is a script for a single account. If you want to operate on multiple accounts in a Manager account, use this version.
2. Get Notified of Google Ads Account Anomalies
This script from Frederick Vallaeys is an upgraded version of the previous one. It also notifies you if the script detects any anomalies in your account, so you can troubleshoot your campaigns before minor issues turn into serious problems.
Frederick’s script is more customizable, and it also gives you more detailed insights. For example, unlike Google’s script, it lets you identify what part of an account is responsible for the anomaly.
3. Goodbye Low Quality Score Script
Daniel Gilbert created a script that helps you get rid of low Quality Score keywords. Goodbye Low Quality Score script finds those keywords so you can easily locate and fix them.
You decide which Quality Score should be considered as low, and the script will email you where the keywords with a score equal or lower to that value are. It’s also possible to let the script pause these keywords for you automatically.
This script is straightforward to use; you need to edit just a few lines:
- EMAIL_ADDRESSES: enter a list of email addresses that should get alerts of the low Quality Score keywords.
- QS_THRESHOLD: enter the Quality Score value that the script will consider as “low.”
- LABEL_KEYWORDS: set it to TRUE if you want the low Quality Score keywords to be automatically labeled.
- LOW_QS_LABEL_NAME: put the name of the label.
- PAUSE_KEYWORDS: set it to TRUE if you want the script to pause keywords with low Quality Score.
We recommend setting up a schedule for this script, so you get alerts when something goes wrong.
4. Automatically Pause Ads with Low CTR
Use this script from Russell Savage to automatically pause ads with the lowest click-through rates. That can be very helpful if you create several ads in ad groups to let Google decide which are the best. The script will find the worst-performing ads in ad groups and pause them.
5. Find Poor Performing Ads
This script from Karooya takes ads performance data from your Google Ads account and recommends which ads you should pause because they do not perform well.
The script will recommend one of the following:
- Pause ads that are performing poorly
- Pause all ads except the best
- Reactivate some of your better-performing ads
Each ad will get a color code:
When you run the script, it creates a folder with the name “Ads Performance Reports” on your Google Drive. In that folder, you will find a result sheet.
Right at the top of that sheet, you will see a recommendation summary that shows what you can achieve if you run only your best ads. After this summary, you will find recommendations for each ad group. Your ads will be highlighted in color codes as we described above.
6. Pause Suspicious Ads Script
Hoofay created a script to check your account for campaigns with a high level of invalid clicks. A high number of invalid clicks can mean that bots attack you, and it would be wise to put those ads on pause.
This script assumes ads as “suspicious” if they have over 30% invalid clicks during the day.
7. Report Campaigns Without Impressions
With this script from Tibbe van Asten, you won’t miss out if one of your campaigns stops for some reason. Report Campaigns Without Impressions automatically notifies you via email if a campaign had no impressions the day before.
You can adjust several values:
- LOG: Set it to TRUE to see what exactly happened. But at the time the script is running, leave it on false; it will work faster.
- EMAIL: Put the email address for notifications.
- EMAIL_INTRO: This is an adjustable message at the top of your email.
- EMAIL_SUBJECT: This is the subject of the notification email.
- DATE_RANGE: Select the date range you want to check for impressions. It is set by default for today.
- COMPARE: Set to TRUE to check the campaigns for impressions before.
- COMPARE_DATERANGE: If you have set COMPARE to TRUE, define the date range you want to compare.
- ACCOUNT_LABEL: Select specific accounts.
8. Pause All Keywords With No Impressions
This script may look similar to the previous one from its name, but it works differently. It automatically pauses or deletes all keywords that have never had an impression, so they will not negatively influence your Quality Score.
We would recommend running this script once a month to keep your account clean from useless keywords.
Alternatively, you can use the Pause / Remove Low Volume Keywords script from Ahmed Ali. The script looks for campaigns, ad groups, and keywords with zero impression for all time and pauses or removes them. On the script landing page, you will find script variations for single and Manager accounts.
9. Exclude Queries With High CPA
This script from Tibbe van Asten looks at all CPAs in campaigns to exclude overpriced search terms. You can define the desired CPA for each campaign within the script. To do this, you need to apply labels to campaigns and specify the desired CPA.
To run the script, set up only the following:
- LOG: If the script should report the intermediate steps, set the value to TRUE.
- THRESHOLD_MULTIPLIER: Use this variable to search terms without conversions. If their CPA is higher than desired, they will be excluded.
10. Exclude Mobile App Ad Placements That Perform Poorly
Now, as Google no longer allows advertisers to exclude mobile app ad placements in bulk, this script from Frederick Vallaeys can be a big help. Exclude Mobile App Ad Placements That Perform Poorly excludes mobile app ad placements with no conversions and a big spend or too high CPA.
This script looks for the string ‘mobileapp’ in the placement performance and analyzes the cost or CPA of that placement. If it exceeds the limit set by the user, it will be added as a negative placement, and the user gets an email notification.
Don’t forget to manage a few script settings:
- LAST_N_DAYS =: Put in the number of days the script looks back from today. The developers recommend setting it not lower than your average time to conversion.
- MAX_CPA =: This is the highest CPA you are ready to pay.
- MAX_COST_NO_CONVERSIONS =: This is the highest allowed cost for a placement with no conversions.
- EMAIL = : Email addresses for notifications.
We would recommend setting this script on a weekly schedule or even more frequently if you have high spendings.
11. Pause Underperforming Ads From Your A/B Tests
This script by Daniel Gilbert is a helpful tool for all PPC managers running A/B tests for their campaigns. Use it to interpret result tests based on your KPIs.
All you need to do is to set a KPI, and the script will choose the best ad from the A/B test in each group. The ads will get labels, and, if you want, the losers will be automatically set on pause. The script also calculates how many extra impressions the winning ad could get if you stop the underperforming version.
12. Low Conversions Cleaner for Search, Video, Display, and Shopping
PPCnerd created a number of scripts to clean up your Search, Video, Display, and Shopping advertising from low converting campaigns, ad groups, and keywords. They are available both for individual and Manager accounts.
They determine all underperforming campaigns, ad groups, and keywords based on a target conversion threshold. You can also include CPA, ROAS, or conversion volume as optimization strategies.
The scripts automatically pause underperforming campaigns and send you an email with a summary.
Here you can find the scripts:
13. Finding Anomalies in Your Keywords, Ad Groups, and Ads
One more script from Russel Savage looks for anomalies in your keywords, ad groups, and ads. This tool detects ad groups, keywords, and ads that perform differently from others in the same ad group or campaign. For example, you can have an ad group with 10 keywords, and one of them can get almost all of the clicks. Or there is an ad group that spends much more than the others. This script helps you not to miss out on such anomalies and take action on them.
The script checks every metric that is available in the AdsApp.stats object. You can modify it to check for such metrics as profit per impression or cost per conversion. Or you can also remove stats that are unimportant to you.
14. Track Return On Ad Spend
Sometimes it can be tedious to monitor ROAS in spreadsheets manually, so this script from Wesley Parker can be a help for many PPC managers. The script takes all the keywords from your account and their corresponding ROAS and creates two charts. These charts show you what percentage of keywords have a specific ROAS and display a week-on-week comparison of your ROAS.
To run this script, adjust the following lines:
- ROAS thresholds: The developer suggests doing this in increments of 100 (e.g., 100, 200, 300). Separate each increment with a comma.
- SHEET: Create a new document in Google Sheets, copy the URL of this sheet, and paste it after =.
- LOOKBACK: The script will take data from this time frame (days).
Wrapping Up
With Google Ads Scripts, you can solve a whole range of tasks. However, you should carefully test that everything works correctly because you will be acting based on this data. We especially recommend being alerted when you use scripts that not just notify you but also perform some actions on your ads, such as pausing or, especially, deleting underperforming keywords, ads, or ad groups. If you are not sure that everything works well, consider using a safe solution like the PromoNavi’s Alerting tool.