Script: Auto-Pause Low ROAS Ad Groups on 48-Hour Drops
Learn how to build a custom Google Ads script to auto-pause low ROAS ad groups after 48-hour consecutive performance drops without breaking Smart Bidding.
By AdTurbo Team · 2026-11-27
Running Google Ads without automated safeguards is one of the fastest ways to burn through your media budget. While automated bidding handles baseline auction dynamics, it regularly overspends on decaying ad groups before Smart Bidding registers an efficiency collapse. When a previously profitable ad group suffers an acute performance drop, manual intervention often happens hours or days too late.
Building a custom JavaScript solution inside Google Ads gives you an objective safety net. By deploying a script auto pause low roas ad groups workflow, you protect your bottom line by terminating ad spend on assets that breach critical return thresholds over consecutive windows.
This guide breaks down the operational mathematics of Return on Ad Spend (ROAS) versus Profit on Ad Spend (POAS), provides production-ready code for a 48-hour consecutive drop monitoring script, and details how to safeguard against attribution delays and Smart Bidding disruptions.
---
Why ROAS Fails: The Mathematical Case for POAS Automation
Most performance marketing teams anchor their budget optimization to Return on Ad Spend. While ROAS is easy to calculate, relying strictly on revenue divided by ad spend creates structural blind spots that distort profitability.
ROAS = Gross Revenue / Ad Spend
If you spend $1,000 to generate $4,000 in top-line revenue, your ROAS is 4.0 (or 400%). However, that figure ignores your cost of goods sold (COGS), payment processing fees, shipping expenses, and variable operational overhead. If the underlying product margin is only 20%, that $4,000 in revenue yields $800 in gross margin. You just spent $1,000 to capture $800 of margin, generating a net operating loss of $200 despite a seemingly healthy 400% ROAS.
The Flaw in ROAS Mechanics
The fundamental issue with raw ROAS metrics in script automation lies in product margin variance:
1. Blended Margins Hide Toxic SKUs: A high-volume ad group may maintain an account-wide target ROAS while disproportionately driving low-margin sales that decrease net cash flow.
2. Fixed Cost Inflexibility: When ad platform click prices spike, high ROAS thresholds fail to account for margin compression across fluctuating inventory costs.
3. False Positives in Budget Allocation: An ad group generating a 5.0 ROAS on a 15% margin product is less valuable than an ad group producing a 2.5 ROAS on an 80% margin product.
Defining Profit on Ad Spend (POAS)
To build resilient automation rules, sophisticated advertisers measure Profit on Ad Spend (POAS):
Gross Profit = Gross Revenue - COGS - Transaction Fees
POAS = Gross Profit / Ad Spend
A POAS of 1.0 represents exact break-even on media investment against gross profit. Anything above 1.0 reflects net contribution margin.
| Metric | Definition | Break-Even Point | Considers Margins? | Automation Risk Level |
| :--- | :--- | :--- | :--- | :--- |
| ROAS | Gross Revenue / Ad Spend | Variable (1 / Margin %) | No | High (risks scaling unprofitable revenue) |
| POAS | Gross Profit / Ad Spend | 1.00 | Yes | Low (directly monitors real cash contribution) |
| CPA | Ad Spend / Conversions | Target Margin / Target CPA | No | Medium (ignores order value fluctuations) |
Whether your conversion pipeline pushes raw revenue (ROAS) or calculated profit values (POAS) into Google Ads, the automation logic remains identical: you must identify consecutive periods of underperformance before shutting off spend.
---
Why a 48-Hour Consecutive Trend Matters More Than 1-Day Flukes
Pausing ad groups after a single bad day is one of the most common mistakes in Google Ads automation. Daily conversion volume fluctuates naturally due to weekday consumer habits, server glitches, payment processor timeouts, and conversion tracking delays.
If your script evaluates a simple 24-hour lookback window, it will trigger false alarms. You risk disabling your highest-performing ad groups simply because a Tuesday afternoon experienced an isolated dip in checkout completions.
The Volatility of Single-Day Windows
Consider an ad group that routinely delivers a 3.5 ROAS. On Wednesday, the ad group spends $150 and logs zero conversions. If an automated rule evaluates that 24-hour block in isolation, it calculates a 0.0 ROAS and immediately pauses the asset.
By Thursday morning, delayed conversions from Wednesday's ad interactions process through the system via Google's attribution pipeline, bringing Wednesday's real ROAS up to 2.8. However, because the ad group was paused Wednesday night, the auction loop was severed, killing the momentum of an otherwise healthy asset.
The Structural Logic of 48-Hour Consecutive Decline
To eliminate single-day variance, our script monitors two distinct, consecutive rolling windows:
• Window A (Yesterday / Day -1): Analyzes spend and conversion value from the most recently completed day.
• Window B (Day Before Yesterday / Day -2): Analyzes the performance of the preceding 24-hour block.
An ad group is only flagged for automated pausing when both Window A and Window B independently fail your minimum target threshold (e.g., ROAS < 1.2 or POAS < 0.8), while maintaining a minimum spend filter to guarantee statistical significance. This operational logic mirrors what an experienced media buyer checks when running a manual PPC campaign management check.
Evaluation Loop:
IF (Day -1 Spend MinSpend AND Day -1 ROAS < TargetThreshold)
AND
(Day -2 Spend MinSpend AND Day -2 ROAS < TargetThreshold)
THEN:
Action - Pause Ad Group
Action - Apply Audit Label ('Auto-Paused: Low ROAS')
Action - Dispatch Notification (Email/Logs)
Requiring performance failure across two consecutive periods eliminates up to 85% of false-positive actions caused by temporary attribution delays and transient consumer behavior.
---
Complete Google Ads Script: Auto-Pause on Consecutive ROAS/POAS Drops
The following Google Ads Script uses the modern Google Ads API reporting framework (GoogleAdsService.search). It evaluates ad group performance across two individual 24-hour windows (yesterday and the day before yesterday), checks for statistical significance via spend thresholds, applies a tracking label, and pauses failing ad groups.
javascript
/
• Google Ads Script: Auto-Pause Ad Groups on Consecutive Low ROAS/POAS Drops
• Evaluates ad groups over two individual 24-hour periods (Yesterday & Day Before Yesterday).
• If an ad group breaches the threshold across both consecutive windows, it is paused
• and labeled for post-mortem auditing.
/
var CONFIG = {
// Minimum threshold below which an ad group is considered failing (e.g., 1.5 = 150% ROAS or 1.5 POAS)
ROASTHRESHOLD: 1.20,
// Minimum spend required per single day to evaluate the threshold (avoids pausing on micro-spend)
MINDAILYSPEND: 25.00,
// Label applied to ad groups when paused by this script
AUDITLABEL: 'AutoPausedLowROAS48h',
// Set to true to execute live pauses. Set to false to test execution safely in preview mode
LIVEEXECUTION: false,
// Optional: List of Campaign Name substrings to ignore (e.g., Brand campaigns)
EXCLUDEDCAMPAIGNPATTERNS: ['Brand', 'Competitor', 'Retention'],
// Optional: Notification recipient for execution alerts
NOTIFICATIONEMAIL: '[email protected]'
};
function main() {
Logger.log('Starting 48-Hour Consecutive ROAS/POAS Drop Monitor...');
// Ensure audit label exists in the account
ensureLabelExists(CONFIG.AUDITLABEL);
var dateYesterday = getDateString(1);
var dateDayBefore = getDateString(2);
Logger.log('Analyzing Window A (Yesterday): ' + dateYesterday);
Logger.log('Analyzing Window B (Day Before): ' + dateDayBefore);
var statsYesterday = getDailyStats(dateYesterday);
var statsDayBefore = getDailyStats(dateDayBefore);
var adGroupsToPause = [];
// Evaluate ad groups present in both evaluation blocks
for (var adGroupId in statsYesterday) {
if (statsDayBefore.hasOwnProperty(adGroupId)) {
var dataY = statsYesterday[adGroupId];
var dataDB = statsDayBefore[adGroupId];
// Verify minimum daily spend requirements are met for both days
if (dataY.cost = CONFIG.MINDAILYSPEND && dataDB.cost = CONFIG.MINDAILYSPEND) {
var roasY = dataY.cost 0 ? (dataY.convValue / dataY.cost) : 0;
var roasDB = dataDB.cost 0 ? (dataDB.convValue / dataDB.cost) : 0;
// Check if both windows breach the minimum acceptable efficiency threshold
if (roasY < CONFIG.ROASTHRESHOLD && roasDB < CONFIG.ROASTHRESHOLD) {
adGroupsToPause.push({
id: adGroupId,
name: dataY.name,
campaignName: dataY.campaignName,
roasYesterday: roasY.toFixed(2),
spendYesterday: dataY.cost.toFixed(2),
roasDayBefore: roasDB.toFixed(2),
spendDayBefore: dataDB.cost.toFixed(2)
});
}
}
}
}
Logger.log('Identified ' + adGroupsToPause.length + ' ad groups breaching consecutive thresholds.');
// Execute pauses and apply labels
executeAdGroupActions(adGroupsToPause);
}
function getDailyStats(dateString) {
var stats = {};
var query = 'SELECT adgroup.id, adgroup.name, campaign.name, metrics.costmicros, metrics.conversionsvalue ' +
'FROM adgroup ' +
'WHERE adgroup.status = "ENABLED" ' +
'AND campaign.status = "ENABLED" ' +
'AND segments.date = "' + dateString + '"';
var response = AdsApp.search(query);
while (response.hasNext()) {
var row = response.next();
var campaignName = row.campaign.name;
// Verify campaign exclusions
var isExcluded = false;
for (var i = 0; i < CONFIG.EXCLUDEDCAMPAIGNPATTERNS.length; i++) {
if (campaignName.indexOf(CONFIG.EXCLUDEDCAMPAIGNPATTERNS[i]) !== -1) {
isExcluded = true;
break;
}
}
if (isExcluded) continue;
var cost = row.metrics.costMicros / 1000000;
var convValue = row.metrics.conversionsValue || 0;
stats[row.adGroup.id] = {
id: row.adGroup.id,
name: row.adGroup.name,
campaignName: campaignName,
cost: cost,
convValue: convValue
};
}
return stats;
}
function executeAdGroupActions(failingAdGroups) {
if (failingAdGroups.length === 0) {
Logger.log('Zero ad groups met pause criteria. Execution complete.');
return;
}
var emailAlerts = [];
for (var i = 0; i < failingAdGroups.length; i++) {
var item = failingAdGroups[i];
var adGroupIterator = AdsApp.adGroups().withIds([item.id]).get();
if (adGroupIterator.hasNext()) {
var adGroup = adGroupIterator.next();
var logMessage = 'Target: "' + item.name + '" in Campaign: "' + item.campaignName + '" | ' +
'Day-1: Spend