Google Ads Script: Catch Midday Conversion Drops via Slack
Build a custom Google Ads script for zero conversion Slack alerts. Monitor midday drops, capture broken tracking instantly, and save wasted spend.
By AdTurbo Team · 2026-11-30
Few moments induce panic like discovering at 5:00 PM that your primary campaigns spent thousands of dollars across hundreds of clicks without logging a single conversion. Whether caused by a broken tag manager trigger, a server-side API outage, a 404 error on a critical landing page, or aggressive click fraud, waiting until the morning reporting cycle guarantees blown budgets and lost revenue.
While Google Ads provides native automated rules, they are fundamentally ill-suited for real-time operational safety. Rules run on strict intervals, struggle with complex intra-day comparison logic, and cannot natively format webhook payloads to communicate with your internal incident management tools.
In this technical guide, you will learn how to write, configure, and deploy a custom google ads script zero conversion slack alert. We will walk through the exact JavaScript code needed to parse hourly performance metrics via Google Ads Query Language (GAQL), establish statistical baseline models to prevent false positives, format incoming webhooks to Slack, and catch catastrophic conversion anomalies before your daily budget evaporates.
---
Why Real-Time Midday Alerts Beat End-of-Day Reporting
Most paid media teams rely on reactive analytics: scheduled looker studio dashboards, daily morning emails, or third-party reporting tools that refresh overnight. This architecture leaves an 8-to-12-hour blind spot where silent failures compound in cost.
The Cost of Silent Failures
Conversion tracking breaks quietly. Unlike a payment failure or an ad disapproval—which triggers an email or UI banner inside Google Ads—tracking breakages show normal account activity. Bidding algorithms (like Target CPA or Maximise Conversions) continue spending your daily budget based on their momentum. If the tracking snippet goes dead at 10:30 AM:
1. Smart Bidding drifts: The bidding algorithm interprets a sudden lack of conversion signals as low-intent traffic, rapidly cutting bids on high-value terms or shifting budget wildly into low-intent display/partner inventory.
2. Direct financial waste: If your account spends $3,000 per day, a 6-hour midday tracking outage burns $750–$1,200 on unmeasured clicks.
3. Attribution disruption: Rebuilding historical conversion data for Smart Bidding is an operational nightmare that can take weeks of manual data import to rectify.
By deploying a midday conversion drop webhook alert, your monitoring system evaluates traffic health every hour. If spend or clicks meet standard statistical thresholds while conversions remain at zero, an alert pushes immediately to your paid media team's Slack channel.
+-------------------------------------------------------------+
| Midday Outage Timeline |
+-------------------------------------------------------------+
| 09:00 AM - Dev updates checkout form / Tag breaks |
| 10:15 AM - High traffic continues; Conversions drop to 0 |
| 11:00 AM - Google Ads Script executes |
| - Flags: Spend $150 & 0 Conversions |
| - Posts JSON webhook to ppc-alerts in Slack |
| 11:05 AM - Media buyer inspects page & alerts engineering |
| Result: Problem solved in 65 mins vs 24 hours |
+-------------------------------------------------------------+
If you find yourself spending excessive time debugging broken setups or diagnosing chronic performance drops, reviewing a comprehensive PPC audit checklist can help uncover root infrastructure errors before they disrupt your campaigns.
---
The Architecture: Google Ads Scripts and Slack Incoming Webhooks
Connecting Google Ads directly to Slack without recurring SaaS middleware (like Zapier or Make) keeps your stack lean, completely free, and secure. Google Ads Scripts run directly on Google's cloud infrastructure via the V8 JavaScript engine.
How Google Ads Scripts Execute
Google Ads Scripts execute directly within your account container. They can pull real-time entity reports using the modern Google Ads Query Language (GAQL), process string/number arrays in memory, and make outbound external HTTP requests via UrlFetchApp.
Because Google Ads Scripts are completely free to run inside Google Ads, you do not need dedicated server hosting, AWS Lambda instances, or paid third-party automation tools to establish continuous account monitoring.
Setting Up a Slack Incoming Webhook
Before diving into the code, you must generate a secure destination endpoint inside your team's Slack workspace:
1. Navigate to the Slack App Directory (api.slack.com/apps) and click Create New App.
2. Select From scratch, name the app (e.g., Google Ads Traffic Monitor), and choose your engineering or marketing workspace.
3. Under Add features and functionality, click Incoming Webhooks.
4. Toggle the switch to Activate Incoming Webhooks.
5. Click Add New Webhook to Workspace at the bottom of the page.
6. Select the dedicated Slack channel where you want alerts delivered (such as google-ads-alerts or paid-ops).
7. Copy the generated Webhook URL. It will look similar to:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Treat this webhook string like an API key. Anyone who possesses this URL can post payloads directly into your chosen channel.
---
Formulating the Anomaly Logic: Preventing False Alarm Fatigue
Writing a script that blindly alerts whenever a campaign has zero conversions will destroy your team's morale within 48 hours. Early in the morning or during normal seasonal dips, natural conversion variance means an account frequently goes 30–90 minutes without logging a conversion.
To build an alert your team actually trusts, you must incorporate two critical safeguards: Click/Spend Thresholds and Hourly Run Windows.
[Script Runs (Hourly)]
|
Is Current Time within Run Window?
(e.g., 11:00 AM to 6:00 PM EST)
/ \
YES NO -- [Exit Script]
/
Fetch Campaign Metrics (TODAY)
|
Does Campaign meet Traffic Thresholds?
(Clicks 35 AND Cost $120)
/ \
YES NO -- [Ignore: Statistical Insignificance]
/
Are Conversions == 0?
/ \
YES NO -- [Healthy: Conversions Detected]
/
[Construct Slack Block Kit Payload]
|
[Send UrlFetchApp.fetch() via Webhook]
1. Setting Minimum Statistical Significance
Never check for zero conversions in a vacuum. Evaluate zero conversions conditional on spend and clicks. For example, if a campaign averages a 4% conversion rate (1 conversion every 25 clicks), encountering zero conversions after 10 clicks is statistically expected (a 66.4% probability of zero conversions occurring purely by chance).
However, if that same campaign registers 60 clicks with zero conversions, the probability of that occurring by random variance drops below 8.6%. At 80 clicks with zero conversions, the probability drops to 3.8%. That is an actionable operational anomaly.
2. Time-of-Day Gating
Avoid running anomaly alerts between midnight and 9:00 AM. In the early morning hours, ad networks rarely accumulate sufficient volume to distinguish between standard variance and true tracking loss. Anchor your script to execute between 11:00 AM and 6:00 PM in your account’s primary operating timezone.
Here is a mathematical guide to help you calibrate your script's trigger criteria:
| Typical Account CVR | Expected Clicks per Conv | Minimum Alert Threshold (Clicks) | Minimum Alert Threshold (Spend at $3 Avg CPC) | Confidence That Zero Is An Anomaly |
| :--- | :--- | :--- | :--- | :--- |
| 1.0% | 100 clicks | 180 clicks | $540 | ~83.5% |
| 2.5% | 40 clicks | 85 clicks | $255 | ~88.4% |
| 5.0% | 20 clicks | 50 clicks | $150 | ~92.3% |
| 8.0% | 12.5 clicks | 35 clicks | $105 | ~94.4% |
| 12.0% | 8.3 clicks | 25 clicks | $75 | ~95.3% |
If you find your campaign performance consistently swinging or costs escalating across all networks without clear visibility, consult our breakdown on why Google Ads is so expensive to balance your spend before setting these baselines.
---
The Complete Google Ads Script: Zero Conversion Slack Alert
Below is the complete, single-file JavaScript solution ready for production deployment. It relies on modern Google Ads Script infrastructure using AdsApp.search(), handles proper timezone offset calculations, dynamically isolates active campaigns, and constructs a polished Slack Block Kit alert payload.
javascript
/
• Google Ads Script: Real-Time Midday Zero Conversion Slack Alert
• Monitors active campaigns for spend/click thresholds with 0 conversions.
/
const CONFIG = {
// PASTE YOUR SECURE SLACK WEBHOOK URL HERE:
SLACKWEBHOOKURL: 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL',
// Minimum clicks logged today before zero-conversion check applies
MINCLICKS: 40,
// Minimum cost (in account currency) logged today before checking
MINCOST: 100.0,
// Account monitoring hours (Local account time: 24-hr format)
STARTHOUR: 11, // 11:00 AM
ENDHOUR: 18, // 6:00 PM
// Optional: Exclude campaigns containing specific naming strings
EXCLUDECAMPAIGNPATTERNS: ['Test', 'Branded', 'Experiment']
};
function main() {
const now = new Date();
const timeZone = AdsApp.currentAccount().getTimeZone();
const currentHour = parseInt(Utilities.formatDate(now, timeZone, 'HH'), 10);
Logger.log('Current Account Time: ' + Utilities.formatDate(now, timeZone, 'yyyy-MM-dd HH:mm:ss'));
// Check if current hour falls within the defined operational monitoring window
if (currentHour < CONFIG.STARTHOUR || currentHour = CONFIG.ENDHOUR) {
Logger.log('Outside monitoring window (' + CONFIG.STARTHOUR + ':00 - ' + CONFIG.ENDHOUR + ':00). Exiting execution.');
return;
}
const offendingCampaigns = detectConversionDrops();
if (offendingCampaigns.length 0) {
Logger.log('Anomalies detected: ' + offendingCampaigns.length + ' campaign(s). Sending Slack alert.');
postAlertToSlack(offendingCampaigns);
} else {
Logger.log('Traffic health check passed: No campaigns meet zero-conversion anomaly criteria.');
}
}
function detectConversionDrops() {
// GAQL Query targeting active campaigns today
const query =
SELECT
campaign.id,
campaign.name,
metrics.clicks,
metrics.costmicros,
metrics.conversions
FROM
campaign
WHERE
campaign.status = 'ENABLED'
AND metrics.clicks = + CONFIG.MINCLICKS +
AND segments.date = TODAY
;
const searchResults = AdsApp.search(query);
const anomalies = [];
while (searchResults.hasNext()) {
const row = searchResults.next();
const campaign = row.campaign;
const metrics = row.metrics;
const name = campaign.name;
const clicks = metrics.clicks;
const cost = metrics.costMicros / 1000000;
const conversions = metrics.conversions;
// Verify campaign is not in the exclusion list
const isExcluded = CONFIG.EXCLUDECAMPAIGNPATTERNS.some(function(pattern) {
return name.toLowerCase().includes(pattern.toLowerCase());
});
if (isExcluded) {
continue;
}
// Evaluation: Cost exceeds threshold AND zero conversions detected
if (cost = CONFIG.MINCOST && conversions === 0) {
anomalies.push({
id: campaign.id,
name: name,
clicks: clicks,
cost: cost.toFixed(2),
conversions: conversions
});
}
}
return anomalies;
}
function postAlertToSlack(campaigns) {
const accountName = AdsApp.currentAccount().getName() || 'Unknown Account';
const accountId = AdsApp.currentAccount().getCustomerId();
let campaignListText = '';
campaigns.forEach(function(c) {
campaignListText += '• ' + c.name + '\n Spend: