Best Free Google Ads Scripts in 2025 (& No-Code Alternatives)
17.2.2025

Best Free Google Ads Scripts in 2025 (& No-Code Alternatives)
17.2.2025

Best Free Google Ads Scripts in 2025 (& No-Code Alternatives)
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Speaker
Results
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
Best Free Google Ads Scripts in 2025 (& No-Code Alternatives)
Managing Google Ads can feel like a never-ending battle. Manually adjusting bids, monitoring underperforming ads, and keeping up with quality scores take hours of work—and mistakes can waste thousands in ad spend.
But what if you could automate these repetitive tasks for free?
This guide covers the best free Google Ads scripts to help you cut wasted spend, optimize performance, and save hours of manual work. And if scripts feel too complex, we’ve also included no-code alternatives so you can automate Google Ads without writing a single line of code.
Why Use Free Google Ads Scripts?
Automating your Google Ads campaigns with scripts can:
✔ Save time by reducing manual work
✔ Cut wasted ad spend by optimizing in real-time
✔ Improve performance with data-driven decisions
✔ Ensure consistency across campaigns
If you're managing multiple campaigns or large ad accounts, Google Ads scripts make automation easier and more efficient.
1. Automatically Pause Ads with Low CTR
Low click-through rates (CTR) mean you’re paying for ads that don’t convert. Manually monitoring CTR across multiple ads is unrealistic, and missing low-performing ads drains your budget.
This script automatically pauses ads when their CTR drops below a defined threshold, preventing wasted spend.
function main() {
var CTR_THRESHOLD = 1.5; // Set your CTR threshold (percentage)
var ads = AdsApp.ads()
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.withCondition("Status = ENABLED")
.forDateRange("LAST_30_DAYS")
.withCondition("Ctr < " + CTR_THRESHOLD)
.get();
while (ads.hasNext()) {
var ad = ads.next();
ad.pause();
Logger.log("Paused ad with low CTR: " + ad.getHeadline());
}
}
⚡ No-script alternative: Shopstory has prebuilt workflows that can automatically pause ads based on underperforming keywords or pause campaigns based on ROAS and Costs (using data from the last 30 days). Automate these for free with Shopstory today.
2. Inventory-Based Bid Adjuster
Running ads for out-of-stock products is one of the biggest budget leaks in ecommerce. If you don’t manually adjust bids, you risk wasting ad spend on items customers can’t buy.
This script syncs Google Ads bids with inventory levels in real-time—lowering bids when stock runs low and restoring them when replenished.
⚠️ Requires linking to a Google Sheet with inventory data.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL"; // Replace with your Google Sheets URL
var SHEET_NAME = "Inventory";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
var data = sheet.getDataRange().getValues();
var inventory = {};
for (var i = 1; i < data.length; i++) {
var product = data[i][0];
var stock = data[i][1];
inventory[product] = stock;
}
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var text = keyword.getText();
if (inventory[text] !== undefined) {
if (inventory[text] == 0) {
keyword.setCpc(0.01);
Logger.log("Reduced bid for out-of-stock item: " + text);
} else {
keyword.setCpc(1.00);
}
}
}
}
⚡ No-script alternative: Get automated notifications via Slack or email by connecting your shop system and setting up one of these relevant flows: Notify me stock drops below 10 items on Shopify, Shopware, or WooCommerce. The minimum number can be adjusted, and you can set up these alerts for free with Shopstory.
3. Keyword Quality Score Tracker by Martin Roettgerding
A low Quality Score means higher CPCs and lower ad rankings. If you don’t track changes over time, you might miss optimization opportunities.
This script by Martin Roettgerding helps you log and track Quality Scores in Google Sheets, so you can analyze trends and make proactive adjustments.
function main() {
var SPREADSHEET_URL = "YOUR_SHEET_URL";
var SHEET_NAME = "Quality Score Tracking";
var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(SHEET_NAME);
sheet.appendRow(["Date", "Keyword", "Quality Score"]);
var keywords = AdsApp.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();
var score = keyword.getQualityScore();
sheet.appendRow([new Date(), keyword.getText(), score]);
Logger.log("Logged Quality Score for: " + keyword.getText());
}
}
⚡ No-script alternative: Automate this with Shopstory's flow "Low Quality Score Keywords Report" for free today. Set your own threshold and receive weekly reports on your keyword performance.
4. Change History Alerts by Nils Rooijmans
Managing Google Ads accounts with multiple users can be risky. If someone modifies bids, budgets, or campaign settings without your knowledge, it could impact performance and waste ad spend.
This script monitors account changes in real time and sends an alert if unapproved modifications occur, ensuring you stay in control of what happens in your Google Ads account.
function main() {
var TIME_RANGE = "LAST_7_DAYS"; // Adjust to your preferred time frame
var query = "SELECT ActionType, ChangeDateTime, User, CampaignName, AdGroupName " +
"FROM CHANGE_HISTORY_REPORT " +
"WHERE ChangeDateTime DURING " + TIME_RANGE;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Change Detected: " + row["ActionType"] +
" by " + row["User"] +
" in Campaign: " + row["CampaignName"] +
", Ad Group: " + row["AdGroupName"] +
" on " + row["ChangeDateTime"]);
}
}
⚡ No-script alternative: Shopstory has multiple change tracking alerts you can easily set up today. Monitor user-specific changes, including modifications to campaigns, ad groups, and keywords. You can also set up daily alerts for changes by specific users, ad group status updates, campaign status updates and more. A daily MCC alert is also available to track changes made by non-team members, including campaign status, ad group status, keyword modifications and budget adjustments.
5. High CPC Bid Alert Script by Nils Rooijmans
Never get surprised by unexpected cost spikes again. This script by Nils Rooijmans sends immediate alerts when your CPC exceeds a set threshold, allowing you to react before overspending.
function main() {
var CPC_THRESHOLD = 5.00; // Set your CPC alert threshold
var keywords = AdsApp.keywords()
.forDateRange("LAST_7_DAYS")
.withCondition("AverageCpc > " + CPC_THRESHOLD)
.get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log("High CPC Alert: " + keyword.getText() + " is at $" + keyword.getCpc());
}
}
⚡ No-script alternative: Set up free custom notifications for all types of Google Ads deviations and anomalies – from significant changes in conversions to detecting click anomalies across your entire Google Ads account.
6. Labelizer by Flowboost
Managing large Google Ads accounts is a nightmare without proper organization. If you have thousands of products and campaigns, it’s easy to lose track of top performers and underperformers.
This invaluable Labelizer script automatically applies labels to campaigns and ad groups based on performance, helping you identify and prioritize high-performing products and segment campaigns efficiently for better bid adjustments.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
if (stats.getConversionRate() > 5) {
campaign.applyLabel("Top Performer");
} else if (stats.getConversionRate() < 1) {
campaign.applyLabel("Underperforming");
}
Logger.log("Labeled campaign: " + campaign.getName());
}
}
⚡ No-script alternative: Shopstory offers a range of Labelizer flows, including best-selling product labels, performance-based labels, discount-based labels, and stock-based labels. Optimize your product feed management easily with Shopstory today!
7. Search Query Report Script by Google
Finding valuable keywords and negative keyword opportunities requires deep analysis, but manually reviewing search terms is exhausting. If you don’t monitor trends, you risk spending on irrelevant searches.
This script automatically generates a detailed search query report helping you identify profitable search terms, find negative keywords to reduce wasted spend, and spot trends in user search behavior.
function main() {
var report = AdsApp.report(
"SELECT SearchTerm, Impressions, Clicks, Cost FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING LAST_30_DAYS"
);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log("Search Term: " + row["SearchTerm"] + " | Clicks: " + row["Clicks"]);
}
}
⚡ No-script alternative: Automate and improve your keyword strategy with Shopstory by automating search term reporting to help identify top-performing keywords and negative keyword opportunities. You can also automate the process of adding negative keywords or promoting high-performing keywords to exact match.
8. Link Checker Script by Tibbe Van Asten
A broken landing page means lost conversions and wasted ad spend, but Google doesn’t notify you when your URLs stop working. Most advertisers only find out after losing money.
This script automatically crawls all ad destinations and detects broken links, redirects, and 404 errors before they impact campaign performance.
If an issue is found, the script pauses the ad to prevent further wasted spend.
function main() {
var ads = AdsApp.ads().get();
while (ads.hasNext()) {
var ad = ads.next();
var url = ad.urls().getFinalUrl();
try {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (response.getResponseCode() == 404) {
ad.pause();
Logger.log("Paused ad due to broken link: " + url);
}
} catch (e) {
Logger.log("Error checking URL: " + url);
}
}
}
⚡ No-script alternative: Automate this without scripts with Shopstory’s “404 Error Notifications” flow, which proactively checks for broken pages and sends weekly alerts.
9. Standard Deviation Anomaly Detector by Bas Baudoin
Campaign performance can suddenly change due to market shifts, algorithm updates, or errors – but if you’re not watching closely, you might not notice until it’s too late.
This script analyzes performance trends and detects unusual activity using statistical models. If something looks off, it sends an alert.
function main() {
var campaigns = AdsApp.campaigns().get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
var stats = campaign.getStatsFor("LAST_30_DAYS");
var cost = stats.getCost();
var avgCost = stats.getAverageCpc() * stats.getClicks();
if (cost > avgCost * 1.5) {
Logger.log("Anomaly detected in: " + campaign.getName());
}
}
}
⚡ No-script alternative: Create anomaly alerts without scripts with Shopstory, helping you monitor significant fluctuations in clicks, conversions, conversion value, costs, and other key metrics.
10. Disapproved Products Alerts
If your Google Shopping products get disapproved, your ads stop showing, but Google doesn’t always notify you fast enough.
This script monitors your shopping feeds and sends alerts when a product gets disapproved, helping you fix feed issues before losing sales, keep your products visible in Shopping Ads, and reduce downtime for high-margin products.
while (products.hasNext()) {
var product = products.next();
Logger.log("Disapproved Product: " + product.getTitle());
}
}
⚡ No-script alternative: Receive daily alerts for newly disapproved or demoted products in your Google Merchant Center account. Details on disapproved items and their causes are automatically stored in a Google Sheet for your review.
Conclusion
These free Google Ads scripts offer powerful automation to help advertisers reduce wasted spend, improve efficiency, and optimize performance without expensive software. Remember to always test scripts in a limited scope before applying them to your entire account, and keep backups of your original settings.
If coding isn’t for you, Shopstory’s no-code automation flows make it easy to achieve the same results—without the technical headaches.
👉 Try Shopstory for free today and start automating your Google Ads campaigns effortlessly.
