Broken Final URL Checker
Checks enabled ad and keyword final URLs for 4xx/5xx errors, with optional sheet logging and daily alerting.
Script Code
Low-effort high-impact script to catch dead landing pages before they waste budget and conversions.
Preview is public. Unlock full code with name and email.
/**
* ==========================================================
* Broken Final URL Checker
* ==========================================================
* Description: Checks enabled keyword/ad final URLs for 4xx/5xx
* and can write results to a Google Sheet.
*
* Copyright (c) 2026 TwoSquares. All Rights Reserved.
* Developed by Kiril Ivanov
*/
function main() {
var SPREADSHEET_URL = "";
var SHEET_NAME = "Broken URL Results";
var SEND_EMAIL_ALERTS = false;
var ALERT_EMAIL = "[email protected]";
// ... preview shortened
}About This Script
Broken Final URL Checker crawls live final URLs used by enabled keywords and ads, then flags pages returning 4xx/5xx status codes. It helps teams catch technical breakages quickly before spend is wasted on dead destinations.
The script deduplicates URLs, records status codes, and can email a focused alert summary. It is designed for operational reliability and supports optional spreadsheet logging for audit history and handover workflows.
If the spreadsheet URL is left blank, it creates a new sheet automatically. If a URL is provided, it writes to that spreadsheet and creates the target tab when missing.
Implementation Notes
- Set SPREADSHEET_URL. Leave blank to auto-create a new sheet on first run.
- Set SEND_EMAIL_ALERTS and ALERT_EMAIL if you want daily notifications.
- Run manually once to authorize UrlFetchApp and Spreadsheet permissions.
- Schedule daily so broken pages are detected before spend accumulates.
- Route flagged URLs to dev/content teams and re-check after fixes.
More Scripts In This Library
Account Anomaly Detector
Compares today’s account performance against the same weekday across previous weeks and alerts when impressions, clicks, conversions, or cost move outside expected bounds.
Campaign Budget Limited Monitor
Surfaces enabled Search campaigns losing impression share due to budget, with optional sheet output and alerting.
Campaign Spend Spike Monitor
Detects campaigns with unusual week-over-week spend spikes and low conversion support, helping catch waste quickly.
Conversion Drop Detector
Compares last 7 days vs prior 7 days by campaign to flag significant conversion drops, with sheet output.
Broken Final URL Checker FAQs
Common setup, usage, and troubleshooting questions for this script.