Google Ads Script Slack Webhook Alert: Catch Low ROAS Fast

Build a custom Google Ads script to send instant Slack webhook alerts when daily ROAS drops below 2.0. Full code, step-by-step setup, and debug guide.

By AdTurbo Team · 2026-10-20

Running Google Ads without real-time performance alerts is like driving at night with your headlights turned off. If a broken checkout, tracking glitch, or erratic bid algorithm causes your Return on Ad Spend (ROAS) to collapse on a Tuesday afternoon, waiting for Friday's manual reporting review can cost you thousands of dollars in wasted ad spend.

By leveraging Google Ads Scripts alongside incoming Slack webhooks, you can automate your daily performance monitoring. In this comprehensive guide, we will build an automated Google Ads script that audits your account daily, calculates your real-time ROAS, and fires a rich Slack webhook alert whenever performance sinks below your threshold (such as a 2.0 ROAS).

---

Why Automate ROAS Alerts to Slack Instead of Email?

Most media buyers and agency owners rely on standard Google Ads email notifications or scheduled reporting spreadsheets. However, email fails when immediate operational action is required.

The Email Inbox Problem

Automated emails from Google Ads frequently land in spam, get caught under promotional filtering tabs, or sit unread in crowded inboxes for hours. Critical failure signals—such as conversion tracking breaking after a website update—get buried under billing receipts and newsletter digests.

Team Speed and Immediate Action

Slack creates visibility across your entire marketing, executive, and operations teams. When an automated Slack alert for low ROAS hits a dedicated triage channel (e.g., ppc-alerts), your team can diagnose the issue within minutes rather than discovering it 48 hours later.

Key advantages of Slack webhook notifications include:

• Real-time visibility: Push alerts surface instantly on desktop and mobile devices.

• Team accountability: Account managers can acknowledge alerts with emoji reactions or thread discussions.

• Formatted payload blocks: Rich JSON payloads let you display metrics cleanly with colors, key-value fields, and direct deep links into the affected Google Ads account.

---

Understanding Google Ads Scripts and Slack Webhooks

Before writing code, it helps to understand how Google Ads Scripts interact with external APIs like Slack's incoming webhooks.

What Are Google Ads Scripts?

Google Ads Scripts are lightweight JavaScript programs executed directly inside the Google Ads platform. Powered by Google's V8 engine, they can read metrics, query historical data using the Google Ads Query Language (GAQL), make bulk modifications to campaigns, and communicate with external web services via the native UrlFetchApp class.

How Slack Incoming Webhooks Work

An incoming Slack webhook is a unique, secure URL generated inside your Slack workspace. When an external program (such as your Google Ads Script) sends an HTTP POST request containing a JSON payload to this URL, Slack converts that JSON payload into a formatted message inside a designated channel. No complex OAuth authorization handshakes or third-party middleware (like Zapier or Make) are required.

Core PPC Use Cases for Scripts and Slack

While this tutorial focuses on ROAS monitoring, production media teams use this same script-to-webhook pipeline for multiple mission-critical automations:

• Account Performance Monitoring: Flagging sudden spikes in Cost Per Acquisition (CPA) or precipitous drops in Conversion Value.

• Disapproved Ads Auditing: Scanning all assets every morning and listing newly disapproved creative in Slack.

• Broken Link Checking: Pinging final URLs across active ads to detect 404 errors or infinite redirects before money is wasted.

• Budget Controlling: Notifying managers when a high-growth campaign hits 90% of its monthly pacing before the 20th of the month.

If you want to evaluate your account's structural health before setting up alerts, consider conducting a complete PPC audit checklist to verify conversion tracking accuracy.

---

Step-by-Step: Setting Up Your Slack Incoming Webhook

Setting up the Slack receiver takes less than five minutes. Follow these exact steps inside your workspace:

Step 1: Create or Select Your Alert Channel

Create a dedicated public or private channel in your Slack workspace. Name it google-ads-alerts or ppc-performance. Dedicated channels keep performance pings separated from general campaign banter.

Step 2: Create a Slack App

1. Navigate to the Slack API Apps Console.

2. Click the green Create New App button.

3. Choose From scratch.

4. Name your app (e.g., Google Ads Monitor) and select your workspace.

5. Click Create App.

Step 3: Enable Incoming Webhooks

1. In the app settings sidebar, click on Incoming Webhooks under the Features heading.

2. Toggle the switch to On.

3. Scroll to the bottom of the page and click Add New Webhook to Workspace.

4. Select the channel you created in Step 1 (e.g., google-ads-alerts) and authorize access.

Step 4: Copy Your Webhook URL

Slack will generate a unique URL formatted like this:

https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Copy this URL to your clipboard. Treat this URL like an API password: anyone with this link can send messages to your Slack channel.

---

The Complete Google Ads Script for Low ROAS Webhook Alerts

Here is the production-ready script. It evaluates yesterday's performance to ensure conversion data has had adequate time to ingest, calculates ROAS, and dispatches a formatted message if ROAS falls below 2.0 (configurable) while exceeding a minimum spend safeguard.

javascript

/

• Google Ads Script: Low ROAS Slack Webhook Alert

• Monitors account ROAS and pushes an alert to Slack when performance falls below target.

/

var CONFIG = {

// Paste your full Slack Incoming Webhook URL below

SLACKWEBHOOKURL: 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL',

// Minimum ROAS threshold (e.g., 2.0 means 200% Return on Ad Spend)

ROASTHRESHOLD: 2.0,

// Minimum spend threshold to prevent false alarms on low-volume days or micro-budgets

MINSPENDTHRESHOLD: 50.00,

// Lookback date range: 'YESTERDAY' or 'TODAY'

// 'YESTERDAY' is recommended to allow conversions to settle

DATERANGE: 'YESTERDAY',

// Optional: Add account nickname for easier identification

ACCOUNTNAME: ''

};

function main() {

var currentAccount = AdsApp.currentAccount();

var accountName = CONFIG.ACCOUNTNAME || currentAccount.getName() || currentAccount.getCustomerId();

var accountId = currentAccount.getCustomerId();

// Fetch account-level performance metrics for the designated period

var stats = currentAccount.getStatsFor(CONFIG.DATERANGE);

var spend = stats.getCost();

var conversionValue = stats.getConversionValue();

var conversions = stats.getConversions();

// Calculate Return on Ad Spend

var roas = spend 0 ? (conversionValue / spend) : 0;

Logger.log('Account: ' + accountName + ' (' + accountId + ')');

Logger.log('Period: ' + CONFIG.DATERANGE);

Logger.log('Spend:

+ spend.toFixed(2));

Logger.log('Conversion Value:

Google Verified Fully Automated

Get More Leads & Sales From Google Ads — On Autopilot

AdTurbo is your AI Google Ads agent, built by top Google Ads agency owners. AdTurbo works tirelessly in the background managing your Google Ads to get more leads and sales, while you focus on running your business.

Sign up with Google

7-day free trial. No contracts. Cancel anytime.

+ conversionValue.toFixed(2));

Logger.log('Conversions: ' + conversions);

Logger.log('Calculated ROAS: ' + roas.toFixed(2));

// Check if spend qualifies for alert and ROAS is below threshold

if (spend = CONFIG.MINSPENDTHRESHOLD && roas < CONFIG.ROASTHRESHOLD) {

Logger.log('CRITICAL: ROAS (' + roas.toFixed(2) + ') is below threshold (' + CONFIG.ROASTHRESHOLD + '). Sending Slack alert...');

sendSlackAlert(accountName, accountId, spend, conversionValue, conversions, roas);

} else {

Logger.log('ROAS is healthy or spend did not meet minimum threshold. No alert required.');

}

}

function sendSlackAlert(accountName, accountId, spend, convValue, conversions, roas) {

var payload = {

"attachments": [

{

"color": "D32F2F", // Danger Red

"blocks": [

{

"type": "header",

"text": {

"type": "plaintext",

"text": "⚠️ Google Ads Alert: Low Daily ROAS Detected",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "mrkdwn",

"text": "Account: " + accountName + " (" + accountId + ")\nEvaluation Period: " + CONFIG.DATERANGE

}

},

{

"type": "section",

"fields": [

{

"type": "mrkdwn",

"text": "Actual ROAS:\n" + roas.toFixed(2) + " (Target: " + CONFIG.ROASTHRESHOLD.toFixed(2) + ")"

},

{

"type": "mrkdwn",

"text": "Total Spend:\n

quot; + spend.toFixed(2)

},

{

"type": "mrkdwn",

"text": "Conversion Value:\n

quot; + convValue.toFixed(2)

},

{

"type": "mrkdwn",

"text": "Conversions:\n" + conversions.toFixed(0)

}

]

},

{

"type": "context",

"elements": [

{

"type": "mrkdwn",

"text": "Check campaign budgets, bids, and tracking immediately. | Automated Alert via Google Ads Scripts"

}

]

}

]

}

]

};

var options = {

'method': 'post',

'contentType': 'application/json',

'payload': JSON.stringify(payload),

'muteHttpExceptions': true

};

try {

var response = UrlFetchApp.fetch(CONFIG.SLACKWEBHOOKURL, options);

var responseCode = response.getResponseCode();

if (responseCode === 200) {

Logger.log('Slack alert sent successfully.');

} else {

Logger.log('Slack API returned error code ' + responseCode + ': ' + response.getContentText());

}

} catch (e) {

Logger.log('Exception while sending Slack alert: ' + e.toString());

}

}

---

How to Deploy and Schedule the Script in Google Ads

Once your code is ready, deploying it directly within your Google Ads UI takes just a few steps.

Step 1: Open the Scripts Workspace

1. Sign in to your Google Ads account.

2. In the top navigation or left sidebar, navigate to Tools and Settings (or Tools in the revised UI).

3. Under Bulk Actions, click Scripts.

Step 2: Create a New Script

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

2. In the top left, give your script a descriptive title: Alert - Daily ROAS < 2.0 (Slack).

3. Delete any default code inside the script editor.

4. Paste the complete script from above into the editor.

5. Replace 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL' with your actual Slack webhook URL.

6. Adjust ROASTHRESHOLD or MINSPENDTHRESHOLD if your business targets differ.

Step 3: Authorize and Preview

1. Click the Authorize button at the bottom right. Grant Google Ads permission to execute scripts and run external network requests on your behalf.

2. Click Preview.

3. Check the Logs tab at the bottom. The script will output account stats and simulate execution. If your ROAS was below 2.0 yesterday, you will see a message post in Slack immediately.

Step 4: Schedule Daily Automated Execution

1. Click Save in the script editor.

2. Return to the Scripts dashboard.

3. Locate your new script in the list, hover over the Frequency column, and click the pencil icon.

4. Select Daily and choose an early morning execution window (e.g., 5:00 AM to 6:00 AM).

5. Click Save.

Setting the schedule between 5:00 AM and 7:00 AM ensures that Google's tracking servers have finalized attribution for "Yesterday" while alerting your team before business hours begin.

---

Troubleshooting, Edge Cases, and Common Pitfalls

While Google Ads Scripts are robust, real-world PPC data can cause false positives or silent script failures if unhandled.

1. The Attribution Delay Dilemma

If your business has a long conversion lag (customers click on Monday but buy on Wednesday), running an alert for TODAY or even YESTERDAY can yield artificially deflated ROAS numbers.

Solution: If your business has a 24-to-48-hour attribution delay, set the script to query a 3-day rolling window using AdsApp.report() or inspect trends across several days rather than relying strictly on single-day figures.

2. Micro-Spend False Alarms

Imagine your account spends $4.50 at 6:00 AM without recording a purchase yet. Technically, your ROAS is 0.00. Without a spending floor, your script would send a panic alert every morning. The MINSPENDTHRESHOLD parameter in our script prevents alerts from firing until your account has accumulated statistically relevant spend.

3. Handling Zero-Spend Days

If your ads are paused, billing has failed, or budgets are depleted, spend will equal 0. Dividing by zero returns NaN (Not a Number) in JavaScript. Our script guards against this using ternary logic:

javascript

var roas = spend 0 ? (conversionValue / spend) : 0;

4. Missing Webhook Authorization

If the logs output an error like Exception: Attribute provided with invalid value: SLACKWEBHOOKURL, ensure your webhook URL contains the full https:// prefix and lacks extra whitespace or trailing quotation marks.

---

Comparison: Custom Scripts vs. Native Alerts vs. AI Automation

Depending on your team size, media spend, and technical comfort, Google Ads scripts are just one of several approaches to monitoring account performance.

| Feature / Dimension | Google Ads Native Alerts | Custom Scripts (Slack Webhook) | Dedicated AI Agent / Automation Platform |

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

| Notification Channel | Email / Web UI Dashboard | Slack / Microsoft Teams / Discord | Slack, SMS, Push, In-App Dashboard |

| Setup Difficulty | Very Easy (Zero code) | Moderate (Requires JavaScript) | Zero Code (Plug & Play) |

| Custom Thresholds | Limited (Fixed system triggers) | Fully Customizable (Any metric or formula) | Dynamic & Autonomous (Self-learning baselines) |

| Auto-Remediation | None (Informational only) | Complex (Can alter bids if scripted) | Automatic (Pauses losers, shifts budgets) |

| Maintenance Cost | None | High (Breaks when Google updates APIs) | Low (Maintained by software vendor) |

| Cost | Free | Free | Paid (e.g., $149/mo) |

If maintaining custom code, dealing with API migrations, and debugging webhook endpoints becomes tedious, modern media buyers often upgrade to full-cycle solutions. For example, AdTurbo's Google Ads AI agent monitors accounts continuously around the clock. Instead of just notifying you that your ROAS plunged, an AI system diagnoses root causes—like toxic search queries or rogue bidding shifts—and can autonomously safeguard your budget.

---

Extending the Script: Campaign-Level Granularity

If you run an account with diverse campaigns (such as high-margin Search campaigns paired with low-margin Performance Max campaigns), evaluating performance strictly at the aggregate account level can hide critical issues.

Here is how you can modify the script to scan campaigns individually and alert only on specific failing campaigns:

javascript

function checkCampaignLevelROAS() {

var campaignIterator = AdsApp.campaigns()

.withCondition("Status = ENABLED")

.withCondition("Cost 50")

.forDateRange("YESTERDAY")

.get();

while (campaignIterator.hasNext()) {

var campaign = campaignIterator.next();

var stats = campaign.getStatsFor("YESTERDAY");

var cost = stats.getCost();

var convVal = stats.getConversionValue();

var campaignROAS = cost 0 ? (convVal / cost) : 0;

if (campaignROAS < CONFIG.ROASTHRESHOLD) {

// Dispatch individual campaign alert to Slack

sendCampaignAlert(campaign.getName(), campaignROAS, cost, convVal);

}

}

}

Running granular campaign checks helps prevent single underperforming tests from hiding beneath overall account profitability, giving your team actionable focus areas every morning. Pair this monitoring with regular analysis of your search terms report to prune non-converting search queries before they damage your return on ad spend.

---

What to Do When the Slack Low ROAS Alert Triggers

Receiving a critical Slack notification is only half the battle. Your team needs an incident response SOP ready to execute the moment an alert appears in your ppc-alerts channel:

[Alert Fires: ROAS < 2.0]

│

▼

1. Verify Tracking & Pixels ──(Broken?)──► Fix Tag Manager / Webhooks

│ (Tracking OK)

▼

2. Inspect Search Terms Report ──(Junk?)──► Add Negative Keywords

│ (Queries Relevant)

▼

3. Review Bid & Budget Changes ──(Spike?)──► Lower Target CPA / tROAS

│ (No Changes)

▼

4. Check LP & Checkout Flow ──(Broken?)──► Resolve Site Errors

1. Verify Conversion Tracking First: Nine times out of ten, a sudden collapse in ROAS without an accompanying traffic drop indicates broken tracking. Check your conversion tags in Google Tag Manager to verify purchases are registering properly.

2. Check the Search Terms Report: Has a broad match keyword suddenly matched against irrelevant, viral queries? Review the query report and immediately deploy negative keywords to stop wasted spend.

3. Inspect Recent Account Changes: Did an automated Smart Bidding strategy increase aggressive bids overnight? Review your Google Ads Change History.

4. Test the Landing Page and Checkout Flow: Visit your active landing pages from mobile and desktop. Complete a test purchase to ensure Stripe, Shopify, or your payment gateway is operating without friction.

To discover how modern automation tools manage these issues systematically, read our complete guide on Google Ads automation.

---

Related Guides

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

• PPC Campaign Management: A Complete Guide for 2026

• Google Ads Not Working? 11 Things to Check Before You Panic

---

Frequently Asked Questions

Can this Google Ads script alter my bids or pause campaigns automatically?

Yes. While the script above only reads metrics and posts notifications to Slack, you can expand its capabilities using native Google Ads script commands like campaign.pause() or biddingStrategy.setTargetRoas(). However, automated changes should be deployed cautiously with strict spending limits to avoid pausing healthy campaigns during transient attribution lags.

How much does it cost to send Google Ads alerts to Slack?

Using Google Ads Scripts and incoming Slack webhooks is 100% free. Google Ads Scripts run at no cost within your Google Ads account, and incoming webhooks are included in both free and paid Slack workspace plans.

Why did my script fail with a "UrlFetchApp" error?

You must authorize the script when prompted inside the Google Ads editor. If authorization was granted and the error persists, ensure your Slack webhook URL is correctly formatted and that your Slack workspace has not revoked the webhook application's channel permissions.

Can I send performance alerts to Microsoft Teams instead of Slack?

Yes. Microsoft Teams supports incoming webhooks using standard HTTP POST requests with JSON payloads (Office 365 Connector Cards or Adaptive Cards). You can modify the JSON payload structure in the sendSlackAlert function to match Microsoft Teams' card schema without altering the core ROAS calculation logic.

Google Verified Fully Automated

Get More Leads & Sales From Google Ads — On Autopilot

AdTurbo is your AI Google Ads agent, built by top Google Ads agency owners. AdTurbo works tirelessly in the background managing your Google Ads to get more leads and sales, while you focus on running your business.

Sign up with Google

7-day free trial. No contracts. Cancel anytime.