Free Tools · Scripts Library

Helpful Google Ads Scripts

Copy-paste scripts that protect your budget and save hours of manual work. Commented, free, no signup. New scripts added regularly.

How to install any script: In Google Ads go to Tools → Bulk actions → Scripts → +, paste the code, click Authorize, then always run Preview first to check the logs before scheduling. Schedule from the Frequency column (hourly/daily as noted per script).

⏰ Budget Pacing Alert

Schedule: hourly · Level: single account · Edit: EMAIL + THRESHOLD

Emails you when any campaign has already spent a high share of its daily budget early in the day — the classic signature of competitor clicking and bot drains. Catch it at 11am instead of discovering it at midnight.

// ===== Budget Pacing Alert — ClickAdsProtector.com =====
// Emails you when a campaign spends too much of its daily
// budget too early. Schedule: HOURLY.

var EMAIL = 'you@yourcompany.com';   // <-- your email
var THRESHOLD = 0.70;                // alert at 70% of budget
var BEFORE_HOUR = 14;                // ...spent before 2pm

function main() {
  var now = new Date();
  var hour = parseInt(Utilities.formatDate(
    now, AdsApp.currentAccount().getTimeZone(), 'HH'), 10);
  if (hour >= BEFORE_HOUR) return; // only check mornings

  var alerts = [];
  var it = AdsApp.campaigns()
    .withCondition('Status = ENABLED').get();

  while (it.hasNext()) {
    var c = it.next();
    var budget = c.getBudget().getAmount();
    var spend = c.getStatsFor('TODAY').getCost();
    if (budget > 0 && spend / budget >= THRESHOLD) {
      alerts.push(c.getName() + ' — spent ' +
        spend.toFixed(2) + ' of ' + budget.toFixed(2) +
        ' (' + Math.round(spend / budget * 100) + '%)');
    }
  }

  if (alerts.length) {
    MailApp.sendEmail(EMAIL,
      '[Google Ads] Budget draining early — ' + alerts.length + ' campaign(s)',
      'These campaigns hit ' + (THRESHOLD * 100) + '% of daily budget before ' +
      BEFORE_HOUR + ':00:\n\n' + alerts.join('\n') +
      '\n\nEarly budget drain is a common sign of click fraud.' +
      '\nCheck your click logs or see clickadsprotector.com');
  }
}

🗂️ IP Exclusion List Backup

Schedule: daily · Level: single account · Edit: SHEET_URL

Google Ads allows max 500 excluded IPs per campaign, and lists get overwritten as tools rotate them. This script snapshots every campaign's IP exclusions into a Google Sheet daily — your audit trail for invalid-click refund claims.

// ===== IP Exclusion Backup — ClickAdsProtector.com =====
// Saves all campaign IP exclusions to a Google Sheet.
// Create a blank Sheet, paste its URL below. Schedule: DAILY.

var SHEET_URL = 'PASTE_YOUR_GOOGLE_SHEET_URL_HERE';

function main() {
  var ss = SpreadsheetApp.openByUrl(SHEET_URL);
  var name = Utilities.formatDate(new Date(),
    AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd');
  var sheet = ss.getSheetByName(name) || ss.insertSheet(name);
  sheet.clear();
  sheet.appendRow(['Campaign', 'Excluded IP / Range']);

  var rows = 0;
  var it = AdsApp.campaigns()
    .withCondition('Status IN [ENABLED, PAUSED]').get();

  while (it.hasNext()) {
    var c = it.next();
    var ips = c.targeting().excludedIpAddresses().get();
    while (ips.hasNext()) {
      sheet.appendRow([c.getName(), ips.next().getIpAddress()]);
      rows++;
    }
  }
  Logger.log('Backed up ' + rows + ' IP exclusions to sheet "' + name + '"');
}

💸 Zero-Conversion Spend Report

Schedule: weekly · Level: single account · Edit: EMAIL + MIN_COST + DAYS

Lists every keyword that spent real money in the last 30 days without a single conversion — sorted by waste. Pair it with your click logs: a high-spend zero-conversion keyword with instant bounces usually means invalid traffic, not a bad keyword.

// ===== Zero-Conversion Spend Report — ClickAdsProtector.com =====
// Emails the keywords that spent money with 0 conversions.
// Schedule: WEEKLY.

var EMAIL = 'you@yourcompany.com'; // <-- your email
var MIN_COST = 20;                 // ignore spend below this
var DAYS = 'LAST_30_DAYS';

function main() {
  var lines = [];
  var it = AdsApp.keywords()
    .withCondition('Status = ENABLED')
    .withCondition('Conversions = 0')
    .withCondition('Cost > ' + MIN_COST)
    .forDateRange(DAYS)
    .orderBy('Cost DESC')
    .withLimit(50).get();

  while (it.hasNext()) {
    var k = it.next();
    var s = k.getStatsFor(DAYS);
    lines.push(s.getCost().toFixed(2) + '  |  ' +
      k.getText() + '  |  ' + s.getClicks() + ' clicks  |  ' +
      k.getCampaign().getName());
  }

  if (lines.length) {
    MailApp.sendEmail(EMAIL,
      '[Google Ads] ' + lines.length + ' keywords burning budget with 0 conversions',
      'Cost | Keyword | Clicks | Campaign\n' +
      '--------------------------------\n' + lines.join('\n') +
      '\n\nHigh spend + zero conversions + instant bounces often = ' +
      'invalid clicks. Verify with landing-page tracking: clickadsprotector.com');
  } else {
    Logger.log('No zero-conversion keywords above ' + MIN_COST);
  }
}

Always test scripts with Preview before scheduling. Scripts are provided as-is — adjust thresholds to your account.

Scripts alert you. We act for you.

Scripts can tell you something is wrong — ClickAds Protector finds the fraudulent IPs behind it and blocks them automatically, 24/7.

See Pricing   Try the Free Targeting Tool →

The Complete Guide to Google Ads Scripts — Automate the Optimisations You Never Have Time to Do

Google Ads Scripts let you automate repetitive optimisation tasks using JavaScript that runs directly inside your Google Ads account. No API credentials, no third-party tools, no developer required. You copy the script, paste it into your account, set a schedule, and it runs automatically — alerting you to problems, making adjustments, and building reports while you sleep.

This free library gives you three professionally written, commented, and tested scripts for the most common automation needs: budget pacing alerts, IP exclusion backup, and zero-conversion spend reports. Copy, paste, run.

Why Google Ads Scripts Are the Most Underused Free Feature in Google Ads

Scripts have been available since 2012 but the majority of advertisers — even experienced ones — have never used them. The reasons are usually "I don't code" or "I don't know where to start." Neither is a real barrier: Google Ads Scripts use basic JavaScript, and every script in this library is fully commented so you know exactly what each line does and what to customise.

The value is enormous. A budget pacing script can save $500+ in a single day by pausing campaigns when you're on track to overspend. A zero-conversion script catches keywords burning budget without results — something manual review misses for weeks. An IP exclusion backup means you never lose your fraud exclusion list to an accidental account reset.

Script 1: Budget Pacing Alert

This script runs every hour and checks whether your campaign spend is on track relative to your daily budget. If spend is running 20% or more above the expected pace for the time of day, it sends an email alert. If you've already reached 100% of daily budget, it sends a critical alert. Customise the threshold, the email address, and the campaign list to monitor.

Why you need it: Google's "Maximise Conversions" and "Target CPA" bidding strategies can overspend daily budgets by up to 100% on high-opportunity days. This is within Google's policy but can destroy monthly budgets. The pacing script catches overruns in real time.

Script 2: IP Exclusion List Backup

This script exports your current campaign-level IP exclusion list to a Google Sheet on a weekly schedule. If you're using click fraud protection (manual or automated), your IP exclusion list is a valuable asset — losing it to an accidental campaign reset or agency handover costs weeks of rebuild time. This script keeps an automatic backup.

Why you need it: IP exclusion lists are not portable by default in Google Ads. They're stored at campaign level, invisible in Editor exports, and not included in account-level backups. This script is the only reliable way to preserve them.

Script 3: Zero-Conversion Keyword Spend Report

This script runs weekly and generates a report of every keyword that has received 10+ clicks in the last 30 days with zero conversions, sorted by spend descending. It emails the report directly to you. These keywords are your biggest optimisation opportunity — either pause them, add negative keywords to tighten their match, or investigate why they're not converting.

How to Install a Google Ads Script

01

Open Scripts

In Google Ads, go to Tools & Settings → Bulk Actions → Scripts. Click the blue "+" button to create a new script.

02

Paste the Code

Copy the script from this page and paste it into the editor. Replace the placeholder values (email address, campaign names, thresholds) with your own.

03

Authorise & Preview

Click "Authorise" to allow the script to access your account data. Then click "Preview" to run it in read-only mode and verify it works as expected.

04

Set Schedule

Click the clock icon to set a run schedule (hourly, daily, weekly, monthly). The budget pacing script should run hourly; others can run weekly.

What People Search When Looking for Google Ads Scripts

People searching for help with Google Ads scripts use dozens of different phrases. Common starting points include searches like "automate Google Ads optimisation script", "budget pacing script Google Ads", "best Google Ads scripts 2025", "copy paste Google Ads scripts", "campaign budget alert Google Ads script", "automated rules vs scripts Google Ads", "click fraud IP exclusion script", "custom report script Google Ads", "alert script Google Ads", and "account level script Google Ads". Each of these search intents points to a real problem advertisers face, and this tool is built to address all of them directly.

As advertisers dig deeper into the topic, they also look for answers to questions such as "daily budget alert Google Ads script", "export IP exclusions Google Ads script", "free Google Ads scripts download", "Google Ads scripts examples", "Google Ads scripts how to use", "Google Ads scripts for beginners", "Google Ads scripts library", "Google Ads scripts no coding", "Google Ads automation scripts", and "Google Ads script scheduler". Each of these search intents points to a real problem advertisers face, and this tool is built to address all of them directly.

More advanced users tend to search for specific guidance around "how to install Google Ads script", "how to use scripts Google Ads", "IP exclusion backup Google Ads", "keyword performance script Google Ads", "low performance keyword report script", "monitor budget Google Ads script", "pause campaign script Google Ads", "performance report Google Ads script", "prevent overspend Google Ads script", and "MCC level scripts Google Ads". Each of these search intents points to a real problem advertisers face, and this tool is built to address all of them directly.

Beginners and experienced advertisers alike frequently ask about "run Google Ads script automatically", "save IP exclusion list Google Ads", "script to pause overspending campaigns", "send email alert Google Ads script", "top performing Google Ads scripts", "wasted spend script Google Ads", "weekly report script Google Ads", "zero conversion keyword script", "zero impression keyword script Google Ads", and "useful Google Ads scripts free". Each of these search intents points to a real problem advertisers face, and this tool is built to address all of them directly.

D – G

  • daily budget alert Google Ads script
  • export IP exclusions Google Ads script
  • free Google Ads scripts download
  • Google Ads scripts examples
  • Google Ads scripts how to use
  • Google Ads scripts for beginners
  • Google Ads scripts library
  • Google Ads scripts no coding
  • Google Ads automation scripts
  • Google Ads script scheduler

H – P

  • how to install Google Ads script
  • how to use scripts Google Ads
  • IP exclusion backup Google Ads
  • keyword performance script Google Ads
  • low performance keyword report script
  • monitor budget Google Ads script
  • pause campaign script Google Ads
  • performance report Google Ads script
  • prevent overspend Google Ads script
  • MCC level scripts Google Ads

R – Z

  • run Google Ads script automatically
  • save IP exclusion list Google Ads
  • script to pause overspending campaigns
  • send email alert Google Ads script
  • top performing Google Ads scripts
  • wasted spend script Google Ads
  • weekly report script Google Ads
  • zero conversion keyword script
  • zero impression keyword script Google Ads
  • useful Google Ads scripts free

Frequently Asked Questions — Google Ads Scripts

Do I need to know JavaScript to use these scripts?

No. All scripts have clear comments explaining what each section does and which values to change. You only need to edit the configuration values at the top (email address, campaign name, threshold). No programming knowledge required.

Can scripts make changes to my account automatically?

Yes — that's the power of scripts. However, always Preview first to verify behaviour before deploying. Start with read-only scripts (reporting and alerts) before using scripts that make changes. The scripts in this library are safe to run but always verify with Preview.

How often can scripts run?

The minimum schedule is hourly. Scripts can run hourly, daily (at a specific time), weekly, or monthly. For budget monitoring, hourly is recommended. For reporting scripts, daily or weekly is sufficient.

Are there limits on what scripts can do?

Scripts have execution time limits (30 minutes for regular scripts) and daily API call limits. For most small-to-medium accounts, these limits are never reached. Very large accounts with thousands of campaigns and keywords may need to optimise scripts for efficiency.

Script Safety — What Can Go Wrong and How to Prevent It

Scripts that make changes to your account carry some risk. The most common mistake is deploying a change script (pausing keywords, adjusting bids) without running Preview first. Always use the Preview button before scheduling any script that makes changes. Preview runs the script in read-only mode and shows exactly what it would do — without actually doing it.

A second safety layer: keep your scripts simple and single-purpose. A script that both pauses low-performing keywords AND adjusts bids is twice as risky as two separate scripts that each do one thing. Complexity increases the chance of unintended behaviour. All scripts in this library are single-purpose for exactly this reason.

Third: set up alerts, not just automated changes, as a first step. A script that emails you when a keyword hits 20 clicks with zero conversions gives you the information to make a manual decision. A script that automatically pauses those keywords makes the decision for you. Start with alerts, graduate to automation once you trust the logic.

MCC-Level Scripts — Managing Multiple Accounts

If you manage Google Ads for multiple clients (as an agency or freelancer), MCC-level scripts can run across all accounts simultaneously. Instead of installing the same script in 10 separate accounts, you install it once at the MCC level and it operates across your entire portfolio. The budget pacing script is particularly valuable at MCC level — one alert system monitoring all your client budgets.

MCC scripts use slightly different syntax (you need to iterate across accounts using AdsManagerApp instead of AdsApp), but the logic is identical. All scripts in this library can be adapted for MCC deployment with minor modifications — the comments in each script note the specific changes required.

Beyond These 3 Scripts — What to Build Next

These three scripts solve the most common automation needs. As your confidence grows, the next scripts to consider are: a Quality Score monitor (alerts when QS drops below 6 for significant-spend keywords), a bid adjustment optimiser (raises bids on high-converting hours/days, lowers them on low-converting periods), a landing page uptime checker (alerts you if your landing page goes offline while ads are still running — common and expensive problem), and a campaign performance dashboard updater (writes daily metrics to a Google Sheet for client reporting). Each of these is available in Google's script library and from specialist PPC blogs — the skills you build with these three foundational scripts apply directly to more advanced automations.

Connecting Scripts to Google Sheets — The Reporting Layer

The most powerful Google Ads scripts write their output to Google Sheets, creating an always-updated dashboard without manual data export. Google Ads Scripts have native Sheets integration via SpreadsheetApp — you can create new sheets, write rows of data, format cells, and share the sheet with clients, all from within the script.

A typical agency setup uses scripts to write daily performance data (impressions, clicks, conversions, cost, CPA) to a Google Sheet, with a second tab showing the previous 30-day trend. The sheet is shared with the client via Google Drive, giving them real-time access to their account data without needing Google Ads access. This is a significant value-add for agency client relationships — and it costs nothing beyond the script writing time.

Scripts vs Automated Rules — Which to Use When

Google Ads has two automation layers: Automated Rules (no-code, UI-based) and Scripts (JavaScript). Automated Rules are easier to set up and sufficient for simple conditions ("pause keywords with CPA over $50 for the last 7 days"). Scripts are necessary for anything requiring complex logic, cross-campaign analysis, external data sources (like a Google Sheet price list), or email alerts. If you can express your automation as a single IF/THEN condition, use Automated Rules. If it requires loops, comparisons across multiple campaigns, or external data, use a Script.

Error Handling in Google Ads Scripts — Building Robust Automations

Production scripts that run on a schedule need error handling to prevent silent failures. A script that crashes halfway through its execution might not alert you — it just stops. Wrapping your script logic in try/catch blocks and using MailApp.sendEmail() to notify you of errors ensures you always know when something goes wrong. All three scripts in this library include error handling that emails you if an unexpected error occurs, along with the error message and line number to help with debugging.

A second reliability practice: add logging statements throughout your script using Logger.log(). These log entries are visible in the script execution log (click "Logs" after a Preview run). Logging each major step — "Checking campaign: Emirates Plumbing," "Budget check: 75% of daily budget used," "No alert needed" — makes it easy to trace exactly what the script did during any given run and identify where problems occurred.

Building Your Own Google Ads Script — Starting Points

Once you're comfortable with these three scripts, building your own is the natural next step. The Google Ads Scripts reference documentation (ads.google.com/aw/scripts) contains the complete API reference for every object and method available. For learning by example, the Google Ads Scripts showcase (ads.google.com/nav/selectaccount?dst=/aw/scripts/showcase) has 50+ pre-built scripts for common use cases including bid management, reporting, budget control, and data integration.

The fastest way to learn is to take one of these library scripts, read it line by line using the comments as a guide, then modify one small thing and Preview it. Iterating on working code is 10x faster than writing from scratch. Start by changing the email address or threshold value, then progress to modifying the logic, then to combining patterns from multiple scripts into a new automation.

Google Ads Scripts for Agency Use — Client Reporting Automation

For agencies managing multiple Google Ads accounts, scripts dramatically reduce reporting overhead. A well-built MCC-level reporting script can pull key metrics from all client accounts, write them to individual Google Sheets (one per client), and email a summary to each client — all running automatically every Monday morning without any manual work. This kind of automation typically saves 5–10 hours per week for agencies managing 10+ accounts, and it eliminates the risk of forgetting to send a client their weekly report during busy periods.

The client-facing output of a reporting script can be as simple as a 5-row table (impressions, clicks, conversions, cost, CPA for the week vs the previous week) or as sophisticated as a full dashboard with trend charts, goal vs actual tracking, and action recommendations. Start simple and add complexity only as clients ask for more detail — most clients want one number (leads generated this week) and one comparison (vs last week). Build your script around that core insight first.