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: