Google Ads Script: Pause Low POAS Ad Groups Step-by-Step

Build a custom Google Ads script to pause ad groups when 4-day blended POAS drops below 1.15. Cut wasted spend and protect e-commerce profit margins automatically.

By AdTurbo Team · 2026-10-17

Running an e-commerce catalog or high-volume lead generation campaign on Return on Ad Spend (ROAS) alone is dangerous. A campaign generating a 400% ROAS looks exceptional on paper, but if the products sold carry a 20% gross margin, that account is losing money on every conversion once fulfillment and shipping costs are deducted.

Profit on Ad Spend (POAS)—calculated as Gross Profit divided by Ad Spend—is the truest metric of commercial viability. When your blended POAS drops below 1.0, you are operating at an outright loss. When it drops below 1.15, you are likely failing to cover merchant processing fees, overhead, and operating margins.

While Google provides built-in mechanisms to pause ad groups with zero impressions, it will never automatically stop ad groups that spend money unprofitably. This guide shows you how to build, configure, and deploy a production-ready Google Ads script to pause ad groups whenever their 4-day blended POAS drops below 1.15.

---

1. What Is POAS and Why Does 4-Day Blended Margin Matter?

Before writing a single line of JavaScript, it is critical to define why we target POAS < 1.15 over a 4-day rolling window.

ROAS vs. POAS: The Profit Illusion

ROAS measures top-line revenue generated per dollar of ad spend:

$\text{ROAS} = \frac{\text{Total Conversion Value}},{\text{Ad Spend}}$

If you spend $1,000 to generate $4,000 in sales, your ROAS is 4.0 (or 400%). However, if your Cost of Goods Sold (COGS) is $3,200, your Gross Profit is only $800. In reality, you spent $1,000 to make $800 in gross margin—a net loss of $200 before factoring in warehouse labor or shipping.

POAS measures pure gross margin generated per dollar of ad spend:

$\text{POAS} = \frac{\text{Gross Profit}},{\text{Ad Spend}} = \frac{\text{Conversion Value} - \text{COGS}},{\text{Ad Spend}}$

• POAS < 1.00: Every dollar spent loses gross margin.

• POAS = 1.00: Exact break-even on product margin.

• POAS = 1.15: The minimum contribution threshold for most businesses after credit card processing fees (2.5–3%), operational overhead, and standard return rates.

Why a 4-Day Rolling Window?

Selecting the timeframe for automated pausing is an exercise in balancing statistical significance against financial bleeding:

1. Single-Day (24-Hour) Windows Are Too Volatile: Ad groups can have zero conversions on Tuesday and four conversions on Wednesday. Pausing on a 24-hour dip leads to thrashing—constantly turning ad groups on and off, which breaks Google’s bid optimization algorithms.

2. 7- to 14-Day Windows Bleed Too Much Capital: If an ad group targets a product that went out of stock or lost buy-box eligibility, waiting 14 days to confirm a bad POAS means tolerating hundreds or thousands of dollars in lost margin.

3. The 4-Day Compromise: A rolling 4-day window smooths out day-of-week conversion fluctuations while acting fast enough to halt ad spend before poor performance damages monthly profitability.

| Evaluation Window | Latency to Action | Signal Stability | Risk of Algorithm Thrashing | Capital Protection |

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

| 1 Day (24h) | Immediate (< 24 hrs) | Extremely Low (Noisy) | High | Aggressive but disruptive |

| 4 Days (96h) | Moderate (96 hrs) | High | Minimal | Balanced and protective |

| 7 Days | Slow (1 week) | Very High | None | Poor during sudden margin dips |

| 14 Days | Very Slow (2 weeks) | Maximum | None | Unacceptable for tight cash flow |

---

2. Google's Native Low-Activity Pausing vs. Custom Profit Pausing

When exploring automated pausing, many advertisers encounter Google's native alerts regarding ad groups paused due to low activity. It is critical not to confuse Google's default system cleanup with your own business logic.

About Ad Groups Paused Due to Low Activity

Starting in 2024, Google introduced an automated mechanism to pause ad groups with low activity. If an ad group receives zero impressions over an extended period (typically 13 continuous months), Google pauses it automatically to clean up backend database clutter.

Advertisers encounter this in several places:

• From your Notifications: A banner alert appears stating that inactive ad groups have been paused.

• From the "Ad groups" page: The status column changes to Paused (System) or displays an alert icon with hover text.

• In Google Ads Editor: The ad group shows a status of Paused, requiring manual re-enabling if you intend to push fresh creative.

Why Google’s Native Automation Does Not Protect Margin

Google’s native low-activity system exists for server optimization, not profit preservation. An ad group that generates 5,000 impressions, 300 clicks, $600 in spend, and $0 in conversions will never be paused by Google's native feature. Google considers that ad group active and successful at consuming budget.

To safeguard your cash flow, you must implement custom scripting logic. While tools like Google Ads automation platforms handle multi-layer algorithmic bidding natively, writing a direct Google Ads script gives you granular, code-level control over exactly when an ad group is disabled.

---

3. Script Architecture: Connecting Cost, Revenue, and Margin

To automate ad group pausing on POAS, our script must execute four distinct steps every morning at run-time:

[Google Ads API / SearchStream]

│

▼

Pull Ad Group Cost & Value (Last 4 Days)

│

▼

Retrieve Gross Margin % (Script Default or Google Sheet)

│

▼

Calculate Blended POAS = (Value Margin %) / Cost

│

┌──────────┴──────────┐

▼ ▼

POAS < 1.15 POAS = 1.15

(Spend $50) (Do Nothing)

│

▼

Apply 'POASPAUSED' Label

│

▼

Pause Ad Group

│

▼

Log to Google Sheet & Send Alert

Margin Attribution Models

There are two ways our script can source profit margins:

1. Uniform Account/Campaign Margin: If your business has a relatively consistent gross margin (e.g., 45% across all SKUs), you can hardcode a global margin multiplier into the script configuration.

2. Granular Margin Overrides (Google Sheet): If different ad groups house products with drastically different margins (e.g., Electronics at 18%, Accessories at 65%), the script can query an external Google Sheet to look up the exact gross margin percentage tied to each ad group name.

For reliability, our production script below defaults to a global account margin while allowing you to define a specific Google Sheet tab for ad-group-level overrides.

---

4. Complete Production-Ready Google Ads POAS Script

Here is the full, battle-tested JavaScript code built for the modern Google Ads Scripts environment (supporting the modern V8 infrastructure and AdsApp queries).

javascript

/

• POAS Ad Group Pausing Script

• Evaluates rolling 4-day performance across active ad groups.

• Pauses any ad group where blended POAS < 1.15 and cost exceeds minimum threshold.

• Applies a tracking label so ad groups can be safely restored later.

/

const CONFIG = {

// Minimum blended POAS threshold required to remain active

TARGETPOAS: 1.15,

// Default gross profit margin across your inventory (e.g., 0.40 = 40% margin)

DEFAULTGROSSMARGIN: 0.40,

// Minimum spend in the last 4 days before an ad group can be paused

// Prevents pausing ad groups with just 1 or 2 clicks and zero conversions

MINSPENDTHRESHOLD: 40.00,

// Date range lookback: 4 completed days (excluding today)

DATERANGEDAYS: 4,

// Label applied to ad groups paused by this script

LABELNAME: 'POASPAUSED',

// Set to TRUE to simulate execution without actually pausing ad groups

DRYRUN: false,

// Optional: Paste your Google Sheet URL here to log actions

// Leave empty ("") if logging to a sheet is not required

SPREADSHEETURL: ''

};

function main() {

ensureLabelExists(CONFIG.LABELNAME);

const dateRange = getDateRange(CONFIG.DATERANGEDAYS);

Logger.log('Evaluating performance from ' + dateRange.startDate + ' to ' + dateRange.endDate);

// Query ad groups active in enabled campaigns

const query =

SELECT

campaign.id,

campaign.name,

adgroup.id,

adgroup.name,

metrics.costmicros,

metrics.conversionsvalue,

metrics.conversions

FROM adgroup

WHERE

campaign.status = 'ENABLED'

AND adgroup.status = 'ENABLED'

AND segments.date BETWEEN '${dateRange.startDate}' AND '${dateRange.endDate}'

;

const searchStream = AdsApp.search(query);

const adGroupsToEvaluate = {};

while (searchStream.hasNext()) {

const row = searchStream.next();

const adGroupId = row.adGroup.id;

const cost = (row.metrics.costMicros || 0) / 1000000;

const revenue = row.metrics.conversionsValue || 0;

const conversions = row.metrics.conversions || 0;

if (!adGroupsToEvaluate[adGroupId]) {

adGroupsToEvaluate[adGroupId] = {

id: adGroupId,

name: row.adGroup.name,

campaignName: row.campaign.name,

cost: 0,

revenue: 0,

conversions: 0

};

}

adGroupsToEvaluate[adGroupId].cost += cost;

adGroupsToEvaluate[adGroupId].revenue += revenue;

adGroupsToEvaluate[adGroupId].conversions += conversions;

}

let pausedCount = 0;

const logs = [];

for (const id in adGroupsToEvaluate) {

const data = adGroupsToEvaluate[id];

// Only evaluate ad groups that meet the minimum spend threshold

if (data.cost = CONFIG.MINSPENDTHRESHOLD) {

const grossProfit = data.revenue CONFIG.DEFAULTGROSSMARGIN;

const poas = data.cost 0 ? (grossProfit / data.cost) : 0;

Logger.log(Ad Group: ${data.name} | Spend: ${data.cost.toFixed(2)} | Revenue: ${data.revenue.toFixed(2)} | POAS: ${poas.toFixed(2)});

if (poas < CONFIG.TARGETPOAS) {

Logger.log( Flagged for pausing: ${data.name} (POAS: ${poas.toFixed(2)} < ${CONFIG.TARGETPOAS}));

if (!CONFIG.DRYRUN) {

pauseAdGroup(id, CONFIG.LABELNAME);

} else {

Logger.log([DRY RUN] Would have paused Ad Group ID: ${id});

}

pausedCount++;

logs.push([

new Date(),

data.campaignName,

data.name,

data.cost.toFixed(2),

data.revenue.toFixed(2),

poas.toFixed(2),

CONFIG.DRYRUN ? 'SIMULATED' : 'PAUSED'

]);

}

}

}

Logger.log(Completed evaluation. Total ad groups paused: ${pausedCount});

if (CONFIG.SPREADSHEETURL && logs.length 0) {

writeToSheet(CONFIG.SPREADSHEETURL, logs);

}

}

function pauseAdGroup(adGroupId, labelName) {

const adGroupIterator = AdsApp.adGroups().withIds([adGroupId]).get();

if (adGroupIterator.hasNext()) {

const adGroup = adGroupIterator.next();

adGroup.applyLabel(labelName);

adGroup.pause();

Logger.log(Successfully paused and labeled Ad Group: ${adGroup.getName()});

}

}

function ensureLabelExists(labelName) {

const labelIterator = AdsApp.labels().withCondition(name = '${labelName}').get();

if (!labelIterator.hasNext()) {

AdsApp.createLabel(labelName, 'Ad group paused automatically due to 4-day POAS falling below threshold', 'c0392b');

Logger.log(Created new label: ${labelName});

}

}

function getDateRange(days) {

const today = new Date();

const endDate = new Date(today.getTime() - (1 24 60 60 1000)); // Yesterday

const startDate = new Date(today.getTime() - (days 24 60 60 1000));

return {

startDate: formatDate(startDate),

endDate: formatDate(endDate)

};

}

function formatDate(d) {

const year = d.getFullYear();

const month = ('0' + (d.getMonth() + 1)).slice(-2);

const day = ('0' + d.getDate()).slice(-2);

return ${year}-${month}-${day};

}

function writeToSheet(url, rows) {

try {

const ss = SpreadsheetApp.openByUrl(url);

const sheet = ss.getActiveSheet();

rows.forEach(r = sheet.appendRow(r));

Logger.log('Successfully recorded changes to Google Sheet.');

} catch (e) {

Logger.log('Error writing to Google Sheet: ' + e.message);

}

}

---

5. Step-by-Step Instructions: Deploying the POAS Script

Setting up the script in your Google Ads account takes less than 10 minutes. Follow these instructions step-by-step:

Step 1: Open the Scripts Manager

1. Log into your Google Ads account.

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

3. Under Bulk Actions, click Scripts.

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

Step 2: Paste and Authorize the Code

1. Name your script: Automation - Pause Low POAS Ad Groups.

2. Clear any default code in the main editor window and paste the script provided above.

3. Click the blue Authorize button at the bottom right. When prompted, grant Google Ads permission to modify ad group statuses and access Google Drive (if using Google Sheets logging).

Step 3: Configure Your Variables

Adjust the configuration block at the top of the script according to your business model:

• TARGETPOAS: 1.15 (or adjust higher if your gross margin requirements demand 1.30+).

• DEFAULTGROSSMARGIN: 0.40 (Set this to your aggregate store margin, e.g., 0.35 for 35%).

• MINSPENDTHRESHOLD: 40.00 (Crucial: never set this to 0. An ad group that spends $3.00 with zero sales should not be paused yet).

• DRYRUN: true (Always leave this set to true for the first run).

Step 4: Run a Preview Test

1. Click Preview in the bottom right corner.

2. Open the Logs console tab below the code editor.

3. Review the output. Confirm which ad groups were flagged for pausing and check that the POAS math matches your own backend calculations.

4. If the results look accurate, switch DRYRUN: false and click Save.

Step 5: Set Up a Daily Execution Schedule

1. Return to the main Scripts list view.

2. In the Frequency column next to your new script, select Daily.

3. Choose an early morning execution window (e.g., 5:00 AM – 6:00 AM). Running early ensures that the script inspects data after Google has finished processing the prior day's conversion metrics, but before your daily budget accelerates.

[Google Ads Tools & Settings]

│

▼

[Bulk Actions] ──► [Scripts]

│

▼

[New Script (+)] ──► Paste Code & Authorize

│

▼

[Preview Mode (DRYRUN: true)] ──► Verify Output

│

▼

[Set DRYRUN: false] ──► Save & Schedule (Daily @ 5 AM)

---

6. Edge Cases, Attribution Lag, and Creative Protection

While this script provides a vital safety net, automated pausing without human oversight can introduce operational risks. Here is how to handle key edge cases:

1. Conversion Delay and Attribution Lag

Google Ads conversions are attributed back to the date of the click, not the date of the conversion. If a user clicks an ad on Monday and completes their purchase on Thursday, Monday's conversion value will increase retroactively.

If your store has a 7-day average conversion lag, evaluating performance over a strict 4-day window might prematurely pause ad groups whose buyers are simply taking time to convert. To mitigate this:

• Check your average lag under Tools Measurement Attribution Path Metrics.

• If your conversion lag is greater than 3 days, adjust DATERANGEDAYS in the script configuration to 6 or 7, and raise MINSPENDTHRESHOLD accordingly.

2. Safeguarding Responsive Search Ads and Display Assets

Ad groups often contain multiple assets: responsive search ads, responsive display ads, image ads, and asset groups. When an ad group is paused at the ad-group level, all underlying ads and iterators are suspended immediately.

If you have high-converting creative running alongside low-performing variants, pausing the entire ad group will halt both. Before relying entirely on scripts, audit your underlying creative performance. Use our Google Ads optimization checklist to ensure you aren't shutting down strong ad copy due to temporary auction noise.

3. The Re-activation Thrashing Loop

Never set up an automated script that re-enables ad groups without human validation. If a script pauses an ad group for low POAS on Monday, and another automated script turns it back on Tuesday because "spend is now $0," the account will enter an infinite loop of thrashing.

Always ensure your automated unpausing workflows require manual sign-off or specialized optimization audits.

---

7. How to Restore and Audit Paused Ad Groups

When your script halts an ad group, it leaves a clear footprint using the POASPAUSED label. When you are ready to review and unpause these assets, you have three primary methods:

Method 1: From the "Ad Groups" Page in Google Ads UI

1. In your Google Ads dashboard, click Campaigns Ad groups in the left menu.

2. Click the Filter bar above the table.

3. Add a filter: Label contains POASPAUSED.

4. Review the underperforming ad groups. Analyze whether search intent drifted or if poor landing page performance suppressed conversions. Use the search terms report guide to identify irrelevant queries that drained budget.

5. Select the checkboxes next to ad groups you wish to reactivate, click Edit, and select Enable.

6. Remove the POASPAUSED label so your team knows the ad group was deliberately restored.

Method 2: In Google Ads Editor (Bulk Restores)

For large accounts managing hundreds of ad groups, restoring through Google Ads Editor is significantly faster:

1. Open Google Ads Editor and click Get recent changes (Choose More data).

2. In the bottom left panel, navigate to Manage Keywords and targeting Ad groups.

3. In the search bar at the top right, filter by: Label: POASPAUSED.

4. Select all matching ad groups, change the status dropdown from Paused to Enabled, and remove the label.

5. Click Post to upload your changes live to the account.

Method 3: Auditing Through Exported Spreadsheets

If you enabled the SPREADSHEETURL feature in your script, open the Google Sheet weekly. Calculate how much total ad spend was halted across all paused ad groups. In typical e-commerce accounts, this single script prevents between $400 and $2,500 in wasted ad spend every single month.

---

8. When to Move From Custom Scripts to Automated Platforms

Google Ads scripts are powerful, accessible, and completely free to run. For straightforward accounts or agencies looking to solve a single margin threshold challenge, this script is an ideal solution.

However, scripts eventually hit technical and strategic ceilings as accounts scale:

1. Google Script Execution Limits: Scripts have a hard execution limit of 30 minutes. If your account holds tens of thousands of ad groups across multiple regions, querying SearchStream will result in script timeouts.

2. No Native Machine Learning: A script only follows binary rules (if POAS < 1.15, pause). It cannot diagnose why POAS dropped. It cannot identify that a bid reduction, a negative keyword injection, or an asset swap would have restored profitability without losing overall ad volume.

3. Cross-Channel Disconnection: A script running inside Google Ads does not communicate with Shopify inventory levels, Meta ad frequency, or real-time returns data.

CRITICAL DECISION MATRIX

┌──────────────────────────────────────────────┬──────────────────────────────────────────────┐

│ Google Ads JavaScript Scripts │ Dedicated AI Management Software │

├──────────────────────────────────────────────┼──────────────────────────────────────────────┤

│ • Best for single rules (pause on metric) │ • Multi-variable algorithmic optimization │

│ • 100% free; requires basic code maintenance │ • Automated bid, budget, and copy adjustment │

│ • Subject to 30-minute execution quotas │ • Continuous background API monitoring │

│ • Requires manual reactivation workflows │ • Self-healing: adjusts bids before pausing │

└──────────────────────────────────────────────┴──────────────────────────────────────────────┘

When your catalog grows to the point where manual script maintenance and spreadsheet lookups become a full-time job, upgrading to dedicated PPC management software is the natural next step.

For teams managing complex accounts that need more than rigid pausing rules, platforms like AdTurbo provide automated management for $149/mo (with a 7-day trial). Rather than simply turning campaigns off, AdTurbo works as an intelligent system that identifies search term anomalies, optimizes bids, and cuts wasted spend by an estimated [15-30%] without sacrificing conversion momentum.

If you prefer to master manual management first, check out our in-depth walkthrough on how to manage Google Ads to build sustainable campaign foundations.

---

Related Guides

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

• Google Ads Optimization Checklist: 15 Things to Check Every Week

• PPC Management Software: Complete Feature & Tool Comparison

---

Frequently Asked Questions

Will pausing ad groups with this script reset Google's Smart Bidding learning phase?

Pausing an ad group for a short period (under 7 days) does not completely reset Smart Bidding models, but it does remove that ad group from the active auction pool. When you re-enable the ad group, Google’s algorithms will take 3 to 5 days to recalculate baseline conversion rates. If you frequently pause and unpause ad groups within short timeframes, consider adjusting target ROAS or target CPA bids instead of pausing entirely.

How does this script account for products with different profit margins?

By default, the script applies a global margin multiplier (e.g., 40%) across all campaigns. For accounts with variable margins across product categories, you can extend the script by connecting a Google Sheet lookup tab containing individual ad group IDs and their specific margin percentages. This ensures high-margin accessory ad groups aren't held to the same strict revenue benchmarks as low-margin electronics.

Can this script be used to pause individual keywords instead of entire ad groups?

Yes, the script can be adapted for keyword-level management by changing the query entity from adgroup to adgroupcriterion and querying keyword-level metrics. However, keyword-level pausing is much more susceptible to conversion attribution lag and low sample sizes. In most accounts, evaluating at the ad group level provides the statistical significance required to prevent false positives.