Script to Auto Pause Low ROAS Search Campaigns Below 1.25

Stop wasting budget. Use this production-ready Google Ads script to auto-pause Search campaigns when daily ROAS drops below 1.25, with midnight resets.

By AdTurbo Team · 2026-11-30

Every media buyer has experienced the cold dread of opening an account at 4:00 PM only to find that a flagship Google Ads Search campaign has burned through $1,800 at a 0.38 ROAS. Whether triggered by broken checkout flows, inventory stockouts, sudden CPC surges from aggressive competitor bidding, or an erratic broad-match expansion, unmonitored performance drops can obliterate profit margins in a single afternoon.

While Google Ads provides automated rules, their execution intervals are sluggish, and native Smart Bidding algorithms are fundamentally designed to average returns over multi-day windows rather than prevent intraday financial bleeding. To preserve capital, advanced practitioners use a script auto pause low roas search campaigns routine that evaluates hourly data, pauses bleeding campaigns when return on ad spend drops below a specific breakeven floor (such as 1.25), and safely reactivates them the next morning.

Below is an end-to-end guide containing an enterprise-grade Google Ads script, installation instructions, attribution lag adjustments, and structural guardrails to automate your account protection.

---

The Problem With Native Smart Bidding During Performance Crashes

Google's Target ROAS (tROAS) and Maximize Conversion Value bidding strategies represent significant technological achievements, but they are built for macroscopic portfolio optimization, not microscopic loss prevention. Relying solely on native Smart Bidding to protect your budget during intraday emergencies exposes your business to structural risks.

Traditional Smart Bidding vs. Intraday Script Guardrails

┌────────────────────────────────────────────────────────┐

│ Smart Bidding: 7-30 Day Optimization Horizon │

│ (Tolerates intraday crashes to find average targets) │

└──────────────────────────┬─────────────────────────────┘

│

▼

┌────────────────────────────────────────────────────────┐

│ Intraday Script: Hourly Real-Time Defense Floor │

│ (Cuts spend instantly if ROAS < 1.25 & Spend Minimum) │

└────────────────────────────────────────────────────────┘

1. Inability to Detect Real-Time Site Breakages

Smart Bidding analyzes historical user intent signals, contextual parameters, and probability matrices. However, Google Ads has zero awareness if your Shopify payment gateway throws a 500 error, your checkout button fails on iOS devices, or your product inventory depletes at 11:00 AM. In these scenarios, Google observes users landing on your site and continues bidding aggressively according to your historical targets. The algorithm will happily exhaust your entire daily budget on non-converting traffic before recognizing days later that conversion volume collapsed.

2. High CPC Spikes on Broad Match and Partner Networks

Smart Bidding algorithms frequently test higher willingness-to-pay thresholds during specific auction hours when user intent appears high. If a competitor withdraws their budget early in the day or a sudden burst of ambiguous broad-match queries enters the auction, average CPCs can spike by 200% to 400%. If those expensive clicks do not convert immediately, your campaign burn rate skyrockets while your real-time ROAS craters. If you are experiencing unexpected expenditure surges, reviewing why Google Ads is so expensive helps clarify the auction mechanics driving sudden click inflation.

3. Google's Multi-Day Averaging Logic

Smart Bidding operates on an aggregated 7-day, 14-day, or 30-day conversion cycle. If your target is a 2.50 ROAS, Google views an intraday crash of 0.60 as acceptable collateral damage provided performance over the previous weekend was 4.00. For businesses operating with strict daily cash-flow requirements or low gross margins, letting a campaign spend $1,000 at a 0.50 ROAS ruins profitability. Implementing a hard google ads automated pause roas threshold establishes a definitive backstop that overrides Google's relaxed averaging windows.

---

Understanding How Google Ads Scripts Read Hourly Data

Google Ads Scripts execute JavaScript directly inside your Google Ads environment using the Google Ads API infrastructure. To build an intelligent safeguard, the script must inspect your account's intraday performance without triggering false-positive pauses during early morning hours.

The Anatomy of an Hourly Performance Query

Modern scripts use the Google Ads Query Language (GAQL) via the AdsApp.search() interface. Instead of downloading clunky reports, the script queries campaign-level resource tables directly using the TODAY date range literal:

sql

SELECT

campaign.id,

campaign.name,

campaign.status,

metrics.costmicros,

metrics.conversionsvalue,

metrics.conversions

FROM campaign

WHERE

campaign.advertisingchanneltype = 'SEARCH'

AND campaign.status = 'ENABLED'

AND segments.date = 'TODAY'

Key Metrics Evaluated by the Script

To determine whether a campaign warrants pausing, the script evaluates three interconnected metrics:

1. metrics.costmicros: The micro-currency cost incurred today. Google delivers financial metrics in micros (1 unit of currency = 1,000,000 micros). A cost of $150.00 is represented as 150000000.

2. metrics.conversionsvalue: The total numeric value attributed to conversions generated today. When tracking dynamic e-commerce revenue, this field contains the gross sales volume.

3. Intraday ROAS Calculation: Computed directly as metrics.conversionsvalue / (metrics.costmicros / 1000000). If a campaign generates $200 in revenue on $200 in spend, its ROAS is 1.00.

Crucially, a script must never pause a campaign based purely on low ROAS without evaluating a minimum spend threshold. At 7:00 AM, a campaign may spend $12.00 and have zero conversions (0.00 ROAS). Pausing it immediately would starve the campaign of volume before it has gathered statistical significance.

| Evaluation Metric | Safe Default Setting | Purpose | Failure Mode If Omitted |

| :--- | :--- | :--- | :--- |

| ROAS Floor | 1.25 | Absolute stop-loss boundary | Unprofitable campaigns run unhindered |

| Minimum Daily Spend | $150.00 (or 2.5x Target CPA) | Statistical significance check | Early morning false-positive pauses |

| Minimum Click Volume | 30 Clicks | Traffic sample validation | Pausing on 2 high-CPC exploratory clicks |

| Evaluation Window | TODAY (Hourly Executions) | Real-time spend governance | End-of-day pauses that save zero capital |

---

The Complete ROAS Breakeven Campaign Pause Script

The production script below contains two operational routines: an intraday audit that checks and pauses low-performing Search campaigns, and a midnight reactivation routine that safely clears the automated pause flags and unpauses campaigns for the next calendar day.

javascript

/

• Google Ads Script: Intraday Low-ROAS Auto-Pause with Midnight Reset

• Author: AdTurbo Engineering

• Purpose: Pauses Search campaigns falling below a 1.25 ROAS threshold

• after exceeding minimum statistical spend limits.

/

const CONFIG = {

ROASFLOOR: 1.25, // Minimum acceptable ROAS threshold

MINSPEND: 150.00, // Minimum spend before ROAS floor applies (in account currency)

LABELNAME: 'AUTOPAUSEDROAS',// Tracking label applied to paused campaigns

APPLYLABEL: true, // Label paused campaigns for easy restoration

SENDEMAILALERTS: true, // Toggle email notifications

NOTIFICATIONEMAIL: '[email protected]', // Recipient email address

DRYRUN: false // Set to true to test logic in console without changing statuses

};

function main() {

checkAndCreateLabel();

const currentHour = new Date().getHours();

// Optional: Run midnight reset during the 00:00 - 01:00 AM execution window

if (currentHour === 0) {

Logger.log('Midnight window detected. Running reactivation routine...');

reactivateCampaigns();

return;

}

evaluatePerformance();

}

function evaluatePerformance() {

Logger.log('Starting intraday campaign ROAS audit...');

const query =

SELECT

campaign.id,

campaign.name,

campaign.status,

metrics.costmicros,

metrics.conversionsvalue,

metrics.clicks

FROM campaign

WHERE

campaign.advertisingchanneltype = 'SEARCH'

AND campaign.status = 'ENABLED'

AND segments.date = 'TODAY'

;

const searchResults = AdsApp.search(query);

const campaignsToPause = [];

while (searchResults.hasNext()) {

const row = searchResults.next();

const campaign = row.campaign;

const metrics = row.metrics;

const cost = metrics.costMicros ? (metrics.costMicros / 1000000) : 0;

const conversionValue = metrics.conversionsValue ? metrics.conversionsValue : 0;

const clicks = metrics.clicks ? metrics.clicks : 0;

const roas = cost 0 ? (conversionValue / cost) : 0;

Logger.log(Campaign: "${campaign.name}" | Spend: ${cost.toFixed(2)} | Revenue: ${conversionValue.toFixed(2)} | ROAS: ${roas.toFixed(2)});

// Verify whether campaign breaches safety rules

if (cost = CONFIG.MINSPEND && roas < CONFIG.ROASFLOOR) {

campaignsToPause.push({

id: campaign.id,

name: campaign.name,

spend: cost,

roas: roas,

revenue: conversionValue

});

}

}

if (campaignsToPause.length === 0) {

Logger.log('All active campaigns meet performance thresholds. No actions taken.');

return;

}

executePauses(campaignsToPause);

}

function executePauses(campaigns) {

let alertBody = 'The following campaigns were paused due to sub-breakeven ROAS:\n\n';

campaigns.forEach(item = {

Logger.log(ACTION: Pausing Campaign "${item.name}" (ID: ${item.id}). Spend: ${item.spend.toFixed(2)}, ROAS: ${item.roas.toFixed(2)});

if (!CONFIG.DRYRUN) {

const campaignIterator = AdsApp.campaigns().withIds([item.id]).get();

if (campaignIterator.hasNext()) {

const liveCampaign = campaignIterator.next();

liveCampaign.applyLabel(CONFIG.LABELNAME);

liveCampaign.pause();

}

} else {

Logger.log([DRY RUN] Would have paused "${item.name}" and applied label ${CONFIG.LABELNAME});

}

alertBody += - ${item.name} | Spend: ${item.spend.toFixed(2)} | ROAS: ${item.roas.toFixed(2)} (Floor: ${CONFIG.ROASFLOOR})\n;

});

if (CONFIG.SENDEMAILALERTS && !CONFIG.DRYRUN) {

MailApp.sendEmail(

CONFIG.NOTIFICATIONEMAIL,

[Google Ads Alert] ${campaigns.length} Campaign(s) Paused Due to Low ROAS,

alertBody

);

}

}

function reactivateCampaigns() {

Logger.log('Locating campaigns paused by ROAS safety scripts for reactivation...');

const labelIterator = AdsApp.labels().withCondition(Name = '${CONFIG.LABELNAME}').get();

if (!labelIterator.hasNext()) {

Logger.log('No pause tracking label found. Nothing to reactivate.');

return;

}

const label = labelIterator.next();

const campaignIterator = label.campaigns().withCondition("Status = 'PAUSED'").get();

let reactivatedCount = 0;

while (campaignIterator.hasNext()) {

const campaign = campaignIterator.next();

Logger.log(Reactivating Campaign: "${campaign.getName()}");

if (!CONFIG.DRYRUN) {

campaign.enable();

campaign.removeLabel(CONFIG.LABELNAME);

} else {

Logger.log([DRY RUN] Would have enabled "${campaign.getName()}" and removed label.);

}

reactivatedCount++;

}

Logger.log(Reactivation routine completed. Restored ${reactivatedCount} campaign(s).);

}

function checkAndCreateLabel() {

const labelIterator = AdsApp.labels().withCondition(Name = '${CONFIG.LABELNAME}').get();

if (!labelIterator.hasNext() && !CONFIG.DRYRUN) {

Logger.log(Label "${CONFIG.LABELNAME}" does not exist. Creating it now.);

AdsApp.createLabel(CONFIG.LABELNAME, 'System label for low-ROAS automated pauses', 'C0392B');

}

}

---

Step-by-Step Installation and Testing in Your Account

Deploying a roas breakeven campaign pause script requires precision. An unverified script running at scale can halt your entire advertising ecosystem if configured incorrectly. Follow this exact workflow:

Script Implementation Flow

[Access Scripts Console] ──► [Authorize API Access] ──► [Run Preview Dry Run]

│

[Schedule 00:00 Reset] ◄── [Schedule Hourly Run] ◄── [Set DRYRUN: false]

Step 1: Access the Scripts Console

1. Sign in to your Google Ads account.

2. Navigate to Tools and Settings (the wrench/spanner icon) in the top-level navigation.

3. Under the Bulk Actions column, click Scripts.

4. Click the blue + button to create a new script.

Step 2: Authorize Account Permissions

Before editing the code, you must authorize execution privileges:

1. Click the Authorize prompt displayed at the top of the interface.

2. Select your Google account that holds Admin permissions on the ad account.

3. Accept the permissions granting the script capability to view reporting data, pause entities, and send automated notifications via Google Apps Mail.

Step 3: Configure Parameters and Run a Preview (Dry Run)

1. Paste the script code directly into the editor pane, replacing any default boilerplate text.

2. In the CONFIG object, update NOTIFICATIONEMAIL to your operational address.

3. Verify that CONFIG.DRYRUN is set to true.

4. Click Preview in the bottom-right corner.

5. Inspect the execution logs in the bottom console. Ensure the script correctly calculates the spend and ROAS metrics of your live campaigns without throwing syntax or API errors. It will indicate which campaigns would be paused without actually pausing them.

Step 4: Schedule Hourly Automation

Once verified:

1. Change CONFIG.DRYRUN: false and click Save.

2. Return to the main Scripts dashboard.

3. Locate your script, find the Frequency column, and change it from None to Hourly.

4. Ensure the schedule executes every hour on the hour. During hours 01:00 through 23:00, it assesses and pauses low-performing campaigns. During hour 00:00 (midnight), it executes the reactivation sequence.

Maintaining these technical safeguard routines is essential for disciplined PPC campaign management, preventing runaway loss cycles before they erode your monthly operating margins.

---

Accounting for Attribution Lag and Conversion Windows

One significant mistake when implementing an automated pause script is neglecting conversion latency (attribution lag). A customer who clicks your ad at 1:00 PM on desktop might compare alternatives on their mobile device and finalize the transaction at 5:30 PM.

If your script evaluates performance at 3:00 PM, it observes all the spend incurred from that click with zero conversion value. If your script thresholds are too aggressive, you risk prematurely killing your most lucrative campaigns simply because customer consideration takes four hours.

Click Occurs (1:00 PM) ────── Spend Logged Instantly ($4.50)

│

├── 2:00 PM: Script checks ROAS = 0.00 (Unadjusted script might pause)

├── 4:00 PM: Customer reviews competitor offerings

│

Purchase Completed (5:30 PM) ── Conversion Value Logged ($185.00) (ROAS jumps to 41.1)

How to Verify Your Attribution Delay

Before setting your intraday ROAS floor, identify your account's exact click-to-conversion timeline:

1. In Google Ads, navigate to Goals Measurement Attribution.

2. Select the Path metrics report from the left navigation and open Time lag.

3. Select "From first impression" or "From first click" to view the distribution of conversion days.

If 80%+ of your conversions complete on Day 0 (the same calendar day), hourly scripts are safe to run. However, if your business has an extended sales cycle where only 30% of conversions occur within the first 6 hours, setting a rigid intraday ROAS floor of 1.25 will cause destructive false positives. In such accounts, you should either:

• Lower the intraday threshold (e.g., from 1.25 to 0.70) to catch catastrophic drop-offs rather than minor underperformances, or

• Increase the MINSPEND gate to 3x your target CPA to allow adequate traffic volume before evaluation.

For a deeper audit of your conversion configuration, refer to our PPC audit checklist.

---

Advanced Customization: Campaign-Level and PMax Adaptation

Not every campaign shares the same economic profile. A branded Search campaign might operate comfortably at an 8.00 ROAS, whereas a competitive generic Search campaign targets a 1.60 ROAS. Applying a uniform 1.25 floor across every campaign can strangle discovery campaigns while letting branded campaigns slide below acceptable tolerances.

Custom Campaign Thresholds via Campaign Labels

You can adapt the script logic to check for custom label thresholds instead of a global constant. For example, if you assign a label named FLOOR2.0 or FLOOR0.9 directly to specific campaigns, you can parse this threshold dynamically:

javascript

// Dynamic threshold extraction logic

let dynamicFloor = CONFIG.ROASFLOOR; // Default 1.25

const labelsIterator = liveCampaign.labels().get();

while (labelsIterator.hasNext()) {

const labelName = labelsIterator.next().getName();

if (labelName.startsWith('FLOOR')) {

dynamicFloor = parseFloat(labelName.split('')[1]);

}

}

if (cost = CONFIG.MINSPEND && roas < dynamicFloor) {

// Trigger campaign pause

}

Applying Guardrails to Performance Max Asset Groups

Performance Max campaigns present a challenge because Google does not allow direct entity-level script pausing for individual Asset Groups via traditional campaign.pause() calls without pausing the entire campaign shell.

To safeguard Performance Max, adapt your query to evaluate advertisingchanneltype = 'PERFORMANCEMAX'. When a Performance Max campaign breaches the floor, the script pauses the parent campaign. Given the volatile inventory placement in PMax (spanning Search, YouTube, Display, and Discover), automated spend stops are even more critical than in pure Search.

Multi-Tiered Action Hierarchy: Alert Before Pausing

Rather than an immediate hard pause, sophisticated enterprise scripts implement a tiered response hierarchy based on the degree of underperformance:

Intraday Spend $150

│

├── ROAS 1.00 - 1.24 ──► TIER 1: Log Warning & Dispatch Internal Slack/Email Alert

│

└── ROAS < 1.00 ──► TIER 2: Hard Pause Campaign & Apply AUTOPAUSEDROAS Label

Tier 1 alerts human operators to examine conversion tags, auction insights, and landing page uptime without disrupting campaign momentum, while Tier 2 acts decisively when spend burns unchecked.

---

Automated Reactivation: Why Midnight Resets Are Essential

Pausing a low-performing campaign resolves the immediate cash drain, but it creates a secondary operational hazard: campaigns forgotten in a paused state. If your team relies on manual campaign reactivation every morning, human error inevitably leads to paused campaigns lingering through prime shopping days.

Managing the Learning Phase and Reactivation Shock

A major concern among media buyers is whether daily pausing damages Smart Bidding models. When a campaign is paused for 8 to 12 hours overnight and reactivated at midnight:

• The bidding algorithm does NOT enter a cold reboot. Google's machine learning models retain historical conversion weightings over short pauses (under 7 days).

• Auction recalculation occurs smoothly. Because the campaign re-enters the auction pool at 00:01 AM, it experiences the natural early-morning rise in click volume alongside normal bidding dynamics.

If your campaigns are frequently triggering pauses multiple days in succession, the issue is rarely temporary volatility. It points to deeper structural problems such as poor keyword intent, mismatched copy, or hyper-inflated bids. If your setup is fundamentally misaligned, explore Google Ads not working: 11 checks to repair foundational tracking and targeting errors.

The Midnight Label Removal Logic

The script’s automated reactivation works by enforcing strict state management through the AUTOPAUSEDROAS label:

javascript

// Verifies the entity was paused specifically by the script, not by a human

const campaignIterator = label.campaigns().withCondition("Status = 'PAUSED'").get();

By checking for both the paused status and the specific script-applied label, the reactivation routine will never mistakenly enable campaigns that an account manager deliberately paused for seasonal, creative, or budgetary reasons.

---

Troubleshooting Common Script Execution Errors

When deploying automated JavaScript code within Google Ads, environment updates and data anomalies can cause script failures. Here is how to diagnose and resolve the four most frequent execution issues:

1. Cannot read property 'costMicros' of undefined

• Cause: Occurs when querying a campaign that has logged impressions but no spend, or when accessing fields returned as null by GAQL.

• Solution: Always wrap micro calculations with conditional fallbacks:

const cost = metrics.costMicros ? (metrics.costMicros / 1000000) : 0;

2. Quota Limits and Execution Timeouts

• Cause: Google Ads Scripts enforce a strict 30-minute maximum execution timeout for single scripts and limits on the number of daily API calls.

• Solution: Add filtering clauses directly into your GAQL WHERE statement (such as campaign.status = 'ENABLED') rather than iterating through thousands of archived or paused campaigns in JavaScript memory.

3. Time Zone Misalignment

• Cause: Discrepancies between your local machine's system time, Google Ads account timezone, and Google Apps Script execution servers. The script checks currentHour === 0 based on the script's default runtime environment.

• Solution: Explicitly extract the date string formatted to your ad account's specific timezone:

javascript

const timeZone = AdsApp.currentAccount().getTimeZone();

const currentHour = parseInt(Utilities.formatDate(new Date(), timeZone, 'HH'), 10);

4. Overlapping Automated Rules and Bidding Adjustments

• Cause: Running native Google Ads Automated Rules alongside scripts with conflicting instructions (e.g., an automated rule increasing bids on high-cost campaigns while this script attempts to pause them).

• Solution: Audit your account via Tools Bulk Actions Automated Rules. Remove legacy rules governing campaign statuses to let the hourly script serve as the single source of truth.

---

Beyond Basic Scripts: Enterprise Guardrails and AI Management

Custom JavaScript scripts provide indispensable immediate protection against sudden performance crashes. However, custom scripts remain deterministic, rigid tools: they evaluate cold static numbers without understanding context, nuance, or underlying causes.

| Capability | Basic Custom Script | Advanced AI PPC Platform (e.g., AdTurbo) |

| :--- | :--- | :--- |

| Action Mechanism | Binary (Pause / Enable) | Multi-Dimensional (Bids, Budgets, Keywords) |

| Search Term Intelligence | None (Operates Campaign-Wide) | Real-Time Negative Keyword Quarantine |

| Contextual Awareness | Zero (Strict Threshold Logic) | Detects Inventory Drops, Seasonality & Latency |

| Maintenance Required | High (API Syntax Updates, Hosting) | Zero Code (Fully Managed Cloud Guardrails) |

| Cost / Setup | Free DIY / Technical Setup | $149/mo (Complete Automated Oversight) |

When a script auto-pauses your search campaign, it preserves your remaining budget, but it also halts sales entirely until tomorrow. In contrast, modern Google Ads automation platforms take corrective tactical actions before a complete shutdown is required.

Rather than pulling the emergency brake on an entire campaign, AdTurbo's PPC management software monitors real-time search terms, isolates wasted spend on rogue queries, dynamically modulates Target ROAS bids downward during conversion troughs, and applies automated negative keywords to stem bleed while keeping profitable core queries active. By integrating autonomous guardrails into your account for $149/mo (accessible with a 7-day trial; credit card required), you protect your margins without sacrificing continuous conversion volume.

If you want to maintain full control over your budget and stop losing money to midday performance crashes, deploy the auto-pause script above today, establish strict breakeven boundaries, and ensure your account never runs unmonitored again.

---

Related Guides

• PPC Audit Checklist: 12 Steps to Fix a Leaking Google Ads Account

• How to Use the Google Ads Search Terms Report to Cut Wasted Spend

• Why Is Google Ads So Expensive? 7 Reasons (And How to Pay Less)

---

Frequently Asked Questions

Will pausing campaigns daily harm my Smart Bidding performance?

Pausing campaigns for brief windows (such as 6 to 12 hours) does not reset your Smart Bidding learning phases, as Google retains historical data across intervals shorter than 7 days. However, if your campaigns are triggering the auto-pause script multiple days in a row, it indicates structural bidding or targeting flaws that need immediate manual recalibration. The pause script should act as an emergency backstop, not a permanent substitute for a healthy bidding strategy.

How do I modify the script if my breakeven ROAS is different?

To adjust your performance threshold, simply change the ROASFLOOR variable at the top of the script inside the CONFIG block. For example, if your breakeven ROAS is 2.10, set ROASFLOOR: 2.10. Make sure you also adjust the MINSPEND variable to roughly 2x to 3x your target CPA so your campaign has sufficient statistical spend before the script evaluates its performance.

Can this script run on Google Performance Max campaigns?

Yes, with minor code adjustments. To include Performance Max campaigns, change the GAQL query filter from campaign.advertisingchanneltype = 'SEARCH' to include 'PERFORMANCEMAX' or remove the channel type restriction entirely. Keep in mind that Performance Max experiences higher intraday conversion reporting delays, so consider setting a lower ROAS floor or higher spend threshold to prevent false-positive pauses.