Skip to content
← ResourcesGoogle AdsMarch 18, 2026 · 9 min read

Review three scripts for pacing, search terms and conversion trends.

Understand, configure and test starter monitoring scripts with the account owner before scheduling writes or emails.

Inside this resource.

6 sections

A map of the published document. Choose a section to start reading.

  1. 01Put this guide to work
  2. 02How to Install Any Script
  3. 03Script 1: Budget Pacing Monitor
  4. 04Script 2: Negative Keyword Miner
  5. 05Script 3: Conversion-Volume Anomaly Monitor
View 1 more sections
  1. What Comes Next
9 min read0 reference tablesFree · no email

Know what each script reads and produces.

These are starter snippets for operator review. A clean log or preview does not certify coverage, correctness or isolation of Sheet/email side effects.

A reading aid for this guide · examples and editorial decisions, not measured account results
ScriptReviewable outputBoundary before scheduling
Budget pacing monitor
A linear pacing approximation for returned campaigns.Review changed/shared budgets, dates and selector coverage; it does not enforce a cap.
Negative keyword miner
Search-term candidates in the configured Sheet.Inspect matching and relevance; the exporter can clear/write its destination and send email.
Conversion-volume monitor
Campaign conversion totals compared across periods.Check lag and gaps; it does not establish that tags or conversion actions are healthy.

Read the full source: How to Install Any Script · Script 1: Budget Pacing Monitor · Script 2: Negative Keyword Miner · Script 3: Conversion-Volume Anomaly Monitor

Jump to a section

Put this guide to work

Understand, configure and test starter monitoring scripts with the account owner before scheduling writes or emails.

Your task: Inspect the scripts and outputs. Record the source, date range and reviewer beside the result. Leave anything you have not checked marked Not checked.

How to interpret it: These are starter snippets for code review, not a verified production installation. The search-term exporter clears/writes its destination Sheet and may send email. The conversion monitor compares campaign-level conversion totals; it does not inspect tag firing, conversion-action status or every campaign type. Allow for conversion lag, low volume and reporting gaps.

Related work: Weekly Diagnostic Checklist · 15-Point Critical Tracking Checklist

How to Install Any Script

Every script follows the same process. Takes about 5 minutes per script.

  1. Open Google Ads. Navigate to Tools and Settings, then Bulk Actions, then Scripts.
  2. Click the blue "+" button to create a new script.
  3. Name the script (use the exact names from this guide for easy reference).
  4. Delete any default code in the editor.
  5. Copy the script code and paste it into the editor.
  6. Update the CONFIG object at the top with your values (spreadsheet URL, email address, thresholds).
  7. Review the code and API compatibility first. Preview is not evidence that external services are isolated: the snippets write/clear Sheets and can email. Use a disposable Sheet and disable email for any permitted test; inspect outputs and errors.
  8. Click "Authorize now" when prompted.
  9. Schedule only after the account owner authorizes the actual Sheet/email effects and a representative test/readback passes. A clean log alone does not validate coverage or correctness.

Google Sheets setup: Use a disposable output Sheet for testing and confirm the actual authorized execution identity can access it. Do not assume a service-account email. Copy the URL into CONFIG only after checking destination and permissions.


Script 1: Budget Pacing Monitor

What it does: Compares month-to-date spend with a linear daily-budget approximation for the campaigns returned by its selector. Appends a status label to Sheets; it does not format colors, enforce a spending cap or cover every campaign type. Budget changes, shared budgets, account timezone and partial-day reporting need separate handling. This approximation is not Google's billing limit.

Schedule: Daily at 6:00 PM.

function main() {
  var CONFIG = {
    SPREADSHEET_URL: 'YOUR_SPREADSHEET_URL_HERE',
    SHEET_NAME: 'Budget Pacing',
    OVERSPEND_THRESHOLD: 1.20,
    UNDERSPEND_LOW: 0.50,
    UNDERSPEND_HIGH: 0.80
  };

  try {
    var ss = SpreadsheetApp.openByUrl(CONFIG.SPREADSHEET_URL);
    var sheet = ss.getSheetByName(CONFIG.SHEET_NAME);
    if (!sheet) { sheet = ss.insertSheet(CONFIG.SHEET_NAME); }

    var today = new Date();
    var dayOfMonth = today.getDate();
    var daysInMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0).getDate();
    var pacingRatio = dayOfMonth / daysInMonth;

    sheet.appendRow([
      'Date', 'Campaign', 'Monthly Budget', 'Month Spend',
      'Expected Spend', 'Pacing %', 'Status'
    ]);

    var campaignIterator = AdsApp.campaigns()
      .withCondition('Status = ENABLED')
      .get();

    while (campaignIterator.hasNext()) {
      var campaign = campaignIterator.next();
      var stats = campaign.getStatsFor('THIS_MONTH');
      var budget = campaign.getBudget().getAmount() * daysInMonth;
      var spent = stats.getCost();
      var expectedSpend = budget * pacingRatio;
      var pacingPct = isFinite(spent) && isFinite(expectedSpend) && expectedSpend > 0
        ? (spent / expectedSpend) : null;

      var status = pacingPct === null ? 'NOT_RATED - Missing/zero pacing basis' : 'GREEN';
      if (pacingPct !== null && pacingPct > CONFIG.OVERSPEND_THRESHOLD) {
        status = 'RED - OVERSPEND';
      } else if (pacingPct !== null && pacingPct < CONFIG.UNDERSPEND_LOW) {
        status = 'YELLOW - SEVERE UNDERSPEND';
      } else if (pacingPct !== null && pacingPct < CONFIG.UNDERSPEND_HIGH) {
        status = 'YELLOW - UNDERSPEND';
      }

      sheet.appendRow([
        Utilities.formatDate(today, AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd'),
        campaign.getName(),
        budget.toFixed(2),
        spent.toFixed(2),
        expectedSpend.toFixed(2),
        pacingPct === null ? 'Not rated' : (pacingPct * 100).toFixed(1) + '%',
        status
      ]);
    }

    Logger.log('Budget pacing report complete. ' + dayOfMonth + '/' + daysInMonth + ' days elapsed.');
  } catch (e) {
    Logger.log('ERROR: ' + e.message);
  }
}

What to customize:

  • OVERSPEND_THRESHOLD: Lower to 1.10 for earlier warnings. 1.20 is the default because small daily fluctuations are normal.
  • UNDERSPEND_LOW / UNDERSPEND_HIGH: Tighten for high-budget campaigns.
  • Monthly budget is calculated as daily budget times days in month. Shared budgets require different handling.

What to watch for:

  • "Cannot read property" error: Confirm the actual authorized script execution identity can access the destination Sheet; do not assume a service account.
  • Budget shows $0: Campaign may use a shared budget.

Script 2: Negative Keyword Miner

What it produces: Search-term review candidates with observed cost. Low clicks, low CTR or zero conversions do not prove irrelevance or recoverable savings. Check lag, missing data and business fit before proposing any exclusion; the suggested match type is a draft, not an execution decision.

Schedule: Weekly, Monday at 7:00 AM.

function main() {
  var CONFIG = {
    SPREADSHEET_URL: 'YOUR_SPREADSHEET_URL_HERE',
    SHEET_NAME: 'Negative Candidates',
    EMAIL_RECIPIENTS: 'you@company.com',
    MIN_CLICKS_ZERO_CONV: 3,
    LOW_CTR_THRESHOLD: 0.005,
    MIN_IMPRESSIONS_CTR: 100,
    DATE_RANGE: 'LAST_30_DAYS'
  };

  try {
    var ss = SpreadsheetApp.openByUrl(CONFIG.SPREADSHEET_URL);
    var sheet = ss.getSheetByName(CONFIG.SHEET_NAME);
    if (!sheet) { sheet = ss.insertSheet(CONFIG.SHEET_NAME); }
    sheet.clear();

    sheet.appendRow([
      'Search Term', 'Campaign', 'Ad Group', 'Clicks', 'Impressions',
      'Cost', 'CTR', 'Conversions', 'Reason', 'Suggested Match Type'
    ]);

    var candidates = [];

    var report = AdsApp.report(
      'SELECT search_term, campaign.name, ad_group.name, metrics.clicks, ' +
      'metrics.impressions, metrics.cost_micros, metrics.ctr, metrics.conversions ' +
      'FROM search_term_view ' +
      'WHERE segments.date DURING ' + CONFIG.DATE_RANGE
    );

    var rows = report.rows();
    while (rows.hasNext()) {
      var row = rows.next();
      var clicks = parseFloat(row['metrics.clicks']);
      var impressions = parseFloat(row['metrics.impressions']);
      var conversions = parseFloat(row['metrics.conversions']);
      var ctr = parseFloat(row['metrics.ctr']);
      var cost = parseFloat(row['metrics.cost_micros']) / 1000000;
      if (![clicks, impressions, conversions, ctr, cost].every(isFinite)) {
        Logger.log('NOT_RATED: missing search-term metrics; review report coverage.');
        continue;
      }
      var reason = '';
      var matchType = '';

      if (clicks >= CONFIG.MIN_CLICKS_ZERO_CONV && conversions === 0) {
        reason = clicks + '+ clicks, 0 conversions';
        matchType = clicks >= 10 ? 'Exact' : 'Phrase';
      }
      else if (impressions >= CONFIG.MIN_IMPRESSIONS_CTR && ctr < CONFIG.LOW_CTR_THRESHOLD && conversions === 0) {
        reason = 'CTR ' + (ctr * 100).toFixed(2) + '% on ' + impressions + ' impressions';
        matchType = 'Phrase';
      }

      if (reason) {
        var entry = [
          row['search_term'], row['campaign.name'], row['ad_group.name'],
          clicks, impressions, cost.toFixed(2), (ctr * 100).toFixed(2) + '%',
          conversions, reason, matchType
        ];
        candidates.push(entry);
        sheet.appendRow(entry);
      }
    }

    if (candidates.length > 0) {
      var topCandidates = candidates.sort(function(a, b) { return b[5] - a[5]; }).slice(0, 20);
      var emailBody = 'Negative Keyword Candidates Found: ' + candidates.length + '\n\n';
      emailBody += 'Top 20 by Cost:\n\n';
      for (var i = 0; i < topCandidates.length; i++) {
        emailBody += (i + 1) + '. "' + topCandidates[i][0] + '" - $' + topCandidates[i][5] +
          ' spent, ' + topCandidates[i][3] + ' clicks, ' + topCandidates[i][8] + '\n';
      }
      MailApp.sendEmail(CONFIG.EMAIL_RECIPIENTS,
        '[Scripts] ' + candidates.length + ' Negative Keyword Candidates Found',
        emailBody);
    }

    Logger.log('Negative keyword mining complete. ' + candidates.length + ' candidates found.');
  } catch (e) {
    Logger.log('ERROR: ' + e.message);
  }
}

What to customize:

  • MIN_CLICKS_ZERO_CONV: Lower to 2 for aggressive mining. Raise to 5 for conservative accounts.
  • LOW_CTR_THRESHOLD: 0.5% is this snippet's example threshold, not an industry or provider standard.
  • Match type cutoff (currently 10 clicks for exact): Adjust based on risk tolerance.

What to watch for:

  • Too many candidates: Add a cost threshold. Only flag terms with more than $5 total spend.
  • Email too long: The script caps at top 20 in the email digest.

Script 3: Conversion-Volume Anomaly Monitor

What it does: Compares enabled campaigns’ aggregate conversion counts over 7- and 30-day windows. Flags unusual declines for investigation. It does not inspect tag firing or individual conversion-action status.

Why this matters: We've seen accounts where the conversion tag stopped firing 3 weeks ago and nobody noticed. The campaigns kept running. The algorithm kept optimizing - on zero data. By the time someone checked, the account had spent thousands bidding blind.

A volume alert is a prompt to investigate tracking, demand, campaign changes and conversion lag. No alert does not establish working tracking.

Schedule: Daily at 8:00 AM.

function main() {
  var CONFIG = {
    SPREADSHEET_URL: 'YOUR_SPREADSHEET_URL_HERE',
    SHEET_NAME: 'Conversion Health',
    EMAIL_RECIPIENTS: 'you@company.com'
  };

  try {
    var ss = SpreadsheetApp.openByUrl(CONFIG.SPREADSHEET_URL);
    var sheet = ss.getSheetByName(CONFIG.SHEET_NAME);
    if (!sheet) { sheet = ss.insertSheet(CONFIG.SHEET_NAME); }
    sheet.clear();

    var today = Utilities.formatDate(new Date(), AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd');
    sheet.appendRow(['Conversion Health Check - ' + today]);
    sheet.appendRow([
      'Campaign', '7d Conversions', '7d Conv Value',
      '30d Conversions', '30d Conv Value', 'Health'
    ]);

    var alerts = [];

    var campaignIterator = AdsApp.campaigns()
      .withCondition('Status = ENABLED')
      .get();

    while (campaignIterator.hasNext()) {
      var campaign = campaignIterator.next();
      var stats7 = campaign.getStatsFor('LAST_7_DAYS');
      var stats30 = campaign.getStatsFor('LAST_30_DAYS');

      var conv7 = stats7.getConversions();
      var conv30 = stats30.getConversions();
      var value7 = stats7.getConversionValue();
      var value30 = stats30.getConversionValue();

      var health = 'NO_VOLUME_ALERT';

      if (![conv7, conv30, value7, value30].every(function(value) {
        return typeof value === 'number' && isFinite(value);
      })) {
        health = 'NOT_RATED - Missing conversion metrics';
        alerts.push(campaign.getName() + ': incomplete conversion metrics; investigation required');
      } else if (conv30 > 5 && conv7 === 0) {
        health = 'CRITICAL - Was converting, now stopped';
        alerts.push(campaign.getName() + ': 0 conversions in 7d (had ' +
          conv30 + ' in 30d)');
      } else if (conv30 > 10 && conv7 < conv30 * 0.1) {
        health = 'WARNING - Conversion volume dropped significantly';
        alerts.push(campaign.getName() + ': ' + conv7 +
          ' conv in 7d vs ' + conv30 + ' in 30d');
      }

      if (health !== 'NO_VOLUME_ALERT') {
        sheet.appendRow([
          campaign.getName(),
          typeof conv7 === 'number' && isFinite(conv7) ? conv7 : 'Not checked',
          typeof value7 === 'number' && isFinite(value7) ? value7.toFixed(2) : 'Not checked',
          typeof conv30 === 'number' && isFinite(conv30) ? conv30 : 'Not checked',
          typeof value30 === 'number' && isFinite(value30) ? value30.toFixed(2) : 'Not checked',
          health
        ]);
      }
    }

    if (alerts.length > 0) {
      var body = 'CONVERSION VOLUME ALERT\n\n';
      body += 'The following campaigns show conversion-volume changes to investigate:\n\n';
      body += alerts.join('\n');
      body += '\n\nImmediate investigation recommended.';
      MailApp.sendEmail(CONFIG.EMAIL_RECIPIENTS,
        '[CRITICAL] Conversion Volume Alert - ' + alerts.length + ' campaign(s)',
        body);
    }

    Logger.log('Conversion-volume review complete. ' + alerts.length + ' configured alerts/unknown-data items found.');
  } catch (e) {
    Logger.log('ERROR: ' + e.message);
  }
}

What to customize:

  • The conv30 > 5 condition skips some low-volume cases; it does not prevent every false alert or establish tracking health. Choose alert thresholds from actual lag and risk.
  • The threshold conv7 < conv30 * 0.1 flags a7-day total below 10% of the overlapping 30-day total; it does not mean a10% period-over-period decline. Set to 0.15 for more sensitive detection.
  • Add campaign type filtering to monitor Search and Shopping separately from Display.

What to watch for:

  • Seasonal campaigns: A campaign that legitimately pauses for the season will trigger a false positive. Exclude seasonal campaigns by name.
  • No volume alerts: no configured anomaly was detected in the campaigns covered. Verify tags and conversion actions separately.

What Comes Next

These three starter scripts support pacing review, query review and conversion-volume anomaly investigation. They neither protect a budget automatically nor certify tracking integrity.

For the complete team-operated workflow, review the Google Ads AI Agentic System. The product page lists the current deliverables, price, license terms and setup responsibilities.

  • Budget and Pacing (3 scripts)
  • Search Term Mining (4 scripts including n-gram analysis and search term clustering)
  • Quality Score Monitoring (3 scripts with daily tracking and component analysis)
  • RSA Performance (3 scripts for asset grading and ad strength monitoring)
  • Bid Strategy Analysis (3 scripts including maturity classification and mismatch detection)
  • Competitor Monitoring (3 scripts for auction insights tracking and new entrant alerts)
  • Shopping and Feed (5 scripts for product labeling, feed health, and price monitoring)
  • Conversion Tracking (3 scripts including conversion lag analysis)
  • Campaign Health (4 scripts for disapproval monitoring, URL checking, and anomaly detection)
  • Automated Reporting (4 scripts for weekly, monthly, and cross-campaign dashboards)

Every script includes a CONFIG object for customization, outputs to Google Sheets, includes error handling, and comes with setup, troubleshooting, and scheduling documentation.

Review and test the applicable snippets with the account owner before choosing which monitoring workflows to install.

Choose who handles the next step.

Use the reference yourself, book a focused paid working session, or have Tegra handle the ongoing channel work.

Search, Shopping, Performance Max and Demand Gen campaigns, plus the research, product feeds, static and video creative, and landing, offer and pre-sale pages behind them.

Explore managed Google Ads → · See paid working sessions →
Get the operator playbook · weekly

One tactical post a week. No fluff.

By subscribing, you agree to get Tegra tactics and product news by email. Unsubscribe anytime. Privacy Policy

Operate this workflow with your team.

Google Ads AI Agentic System · $19,997

The licensed system gives your team the source, workflows and references to prepare, review and operate this work. Installation and process-integration help are included at no additional fee, with rollout scope agreed together. Provider usage and ongoing management are separate.

See the system→