Shopping zombie SKU script for Google Ads
A free, read‑only Google Ads Script that sorts Shopping products onto three tabs of a Google Sheet. Products that barely show, products that spend without converting, and products that sell other items through the cart. MIT licensed.
Configures the script in this tab. Copy or download the MIT .js file and paste it into Google Ads Scripts. Where your data goes
shopping-
5 KB · 152 lines
- Reads
- shopping_performance_view
- Writes
- Your Google SheetOptional email
- Changes in Google Ads
- None
- Runs in
- One account
- Suggested frequency
- Weekly
- License
- MIT
/** * Shopping Zombie SKU & Cross-Sell Detector * Read-only Google Ads Script (MIT License) * Copyright (c) 2026 Parallel AI, Inc. * https://www.withparallel.ai * Docs & configurator: * https://www.withparallel.ai/scripts/shopping-zombie-sku-detector * Repository: * https://github.com/parallel-ai-inc/google-ads-scripts * * Changes in Google Ads: None (reads via AdsApp.search). * Google Ads is a trademark of Google LLC. Parallel AI is * not affiliated with or endorsed by Google. */const CONFIG = { LOOKBACK_DAYS: "LAST_30_DAYS", ZOMBIE_MAX_IMPRESSIONS: 50, BLEEDER_MIN_COST: 75, INCLUDE_CART_CROSS_SELL: true, SPREADSHEET_URL: "", EMAIL_RECIPIENTS: "",};Lines 24 to 152The script body, the same for every setting
function main() { const selectFields = [ "campaign.name", "segments.product_item_id", "segments.product_title", "segments.product_brand", "metrics.impressions", "metrics.clicks", "metrics.cost_micros", "metrics.conversions", "metrics.conversions_value", ]; if (CONFIG.INCLUDE_CART_CROSS_SELL) { selectFields.push("metrics.all_cross_sell_units_sold"); selectFields.push("metrics.all_cross_sell_revenue_micros"); } const query = [ "SELECT " + selectFields.join(", "), "FROM shopping_performance_view", "WHERE segments.date DURING " + CONFIG.LOOKBACK_DAYS, "ORDER BY metrics.cost_micros DESC", ].join("\n"); const bySku = {}; const rows = AdsApp.search(query); while (rows.hasNext()) { const row = rows.next(); const seg = row.segments || {}; const m = row.metrics || {}; const sku = String(seg.productItemId || ""); if (!sku) continue; if (!bySku[sku]) { bySku[sku] = { sku, title: String(seg.productTitle || ""), brand: String(seg.productBrand || ""), impr: 0, clicks: 0, cost: 0, conv: 0, value: 0, crossUnits: 0, crossRev: 0, }; } const acc = bySku[sku]; acc.impr += Number(m.impressions || 0); acc.clicks += Number(m.clicks || 0); acc.cost += Number(m.costMicros || 0) / 1e6; acc.conv += Number(m.conversions || 0); acc.value += Number(m.conversionsValue || 0); acc.crossUnits += Number(m.allCrossSellUnitsSold || 0); acc.crossRev += Number(m.allCrossSellRevenueMicros || 0) / 1e6; } const zombies = []; const bleeders = []; const crossSell = []; Object.keys(bySku).forEach((sku) => { const s = bySku[sku]; if (s.impr <= CONFIG.ZOMBIE_MAX_IMPRESSIONS) { zombies.push([ s.sku, s.title, s.brand, s.impr, s.clicks, round2(s.cost), ]); } if (s.conv === 0 && s.cost >= CONFIG.BLEEDER_MIN_COST) { bleeders.push([ s.sku, s.title, s.brand, s.clicks, round2(s.cost), s.conv, ]); } if (CONFIG.INCLUDE_CART_CROSS_SELL && s.crossRev > 0) { crossSell.push([ s.sku, s.title, round2(s.cost), round2(s.value), round1(s.crossUnits), round2(s.crossRev), ]); } }); const sheet = openOrCreateSheet( CONFIG.SPREADSHEET_URL, "Parallel AI - Shopping Zombie SKUs" ); writeTab(sheet, "Zombie SKUs", [ "Item ID", "Product title", "Brand", "Impressions", "Clicks", "Cost", ], zombies); writeTab(sheet, "Zero-conv spenders", [ "Item ID", "Product title", "Brand", "Clicks", "Cost", "Conversions", ], bleeders); if (CONFIG.INCLUDE_CART_CROSS_SELL) { writeTab(sheet, "Cross-sell cart", [ "Item ID", "Product title", "Cost", "Direct value", "Cross-sell units", "Cross-sell rev", ], crossSell); } if (CONFIG.EMAIL_RECIPIENTS && (zombies.length > 0 || bleeders.length > 0)) { MailApp.sendEmail( CONFIG.EMAIL_RECIPIENTS, "Shopping SKU check: " + zombies.length + " zombies, " + bleeders.length + " non-converters", "Review segmented SKU tabs in: " + sheet.getUrl() ); } Logger.log("Sheet URL: " + sheet.getUrl());}function round2(n) { return Math.round(n * 100) / 100; }function round1(n) { return Math.round(n * 10) / 10; }function safeCell(val) { if (typeof val !== "string") return val; if (/^[=+@]/.test(val) || /^-[^0-9.]/.test(val)) return "'" + val; return val;}function openOrCreateSheet(url, fallbackName) { return url ? SpreadsheetApp.openByUrl(url) : SpreadsheetApp.create(fallbackName);}function writeTab(spreadsheet, name, headers, rows) { let tab = spreadsheet.getSheetByName(name); if (!tab) tab = spreadsheet.insertSheet(name); tab.clearContents(); const safeRows = rows.map((r) => r.map(safeCell)); const data = [headers].concat(safeRows); tab.getRange(1, 1, data.length, headers.length).setValues(data);}Install it in Google Ads
- Set the thresholds on this page, then copy the script or download the .js file.
- In Google Ads, open Tools, then Bulk actions, then Scripts, and add a new script.
- Paste the script over the starter code and give it a name.
- Google Ads asks you to authorize the script the first time. That happens in your own account, under your Google login.
- Choose Preview. Copy the Google Sheet URL from the last log line and paste it into SPREADSHEET_URL so scheduled runs reuse one Sheet instead of creating a new one each time.
- Set its frequency on the Scripts page. Weekly suits this script.
What it reads and the rules it follows
One query on shopping_performance_view, through AdsApp.search, added up by item ID. It asks for impressions, clicks, cost, conversions and conversion value, and for cross‑sell units and revenue when that switch is on. Cost is in the account’s own currency.
- Reads shopping_performance_view grouped by segments.product_item_id alongside impressions, clicks, spend, conversions, conversion value, and cross‑sell cart metrics when reported.OfficialGoogle Ads API v26 shopping_performance_view
- Separating low‑impression zombie SKUs from high‑spend zero‑conversion SKUs lets you diagnose feed visibility issues independently of unprofitable bids.Practitioner rule
The Sheet it writes
Three tabs. Zombie SKUs lists products at or under the impression cap. Zero‑conv spenders lists products with no conversions and cost at or over the floor. Cross‑sell cart lists products whose clicks led to sales of other items, with the units and revenue Google reports. With an alert email set, Google Ads Scripts sends one from your account when a run finds a zombie or a spender.
| Item ID | Product title | Brand | Impressions | Clicks | Cost |
|---|---|---|---|---|---|
| CTG-PACK-45L | Ultralight 45L Trail Pack | Cinder Trail | 12 | 0 | 0.00 |
| CTG-STOVE-TI | Titanium Pocket Stove | Cinder Trail | 38 | 1 | 1.45 |
What it cannot tell you
- It lists the products Google Ads returns for the window. A product that is missing from the report is missing from the Sheet, so look in Merchant Center for products that are not there at all.
- Cross‑sell figures need conversions that report cart data. Without cart data the tab holds its header row alone.
- It does not match the item clicked to the item bought row by row. Cross‑sell units and revenue are Google’s totals for each product.
- A zombie is a count of impressions, not a cause. A low bid, a disapproval and a thin feed title all look the same on the tab.
- It changes no bid, no product group and no feed.
Where your data goes
This page builds the script’s text in your browser tab. It asks for no login and connects to no Google Ads account.
A Sheet address or an alert email you type goes into the script’s text, so the copy is ready to paste. The link you copy holds thresholds and switches only, in the part of the address after the # sign, which a browser does not send when it requests a page.
Once pasted, the script runs inside Google Ads Scripts under your Google account. It reads the account, writes to your Google Sheet and sends the optional email from your account. Nothing in it calls Parallel AI.
Site analytics are separate from the script. If you accepted analytics cookies, they record how pages on this site are used, which can include what is on the screen. The privacy policy covers site analytics and your consent settings.
On a live account
A script sorts products by two thresholds. Parallel AI is the AI agent platform for Google Ads. A Google Ads AI agent reads product performance across every connected account, sets it beside bids, budgets and campaign structure, and writes the findings to a Sheet.
Questions and answers
Is the script free?
Yes. It is open source under the MIT license, with no login, no trial and no email address. The whole file is on this page and on GitHub.
What is a zombie SKU?
A product in the feed that gets almost no impressions. The script counts a product as one when its impressions in the window are at or under the cap in the settings, which ships at 50.
Does the script change bids or the feed?
No. It reads with AdsApp.search and writes to a Google Sheet. It has no call that changes a bid, a product group, a budget or a status.
Why is the cross‑sell tab empty?
Cross‑sell units and revenue appear only when conversions report cart data. Turn the switch off and the script leaves the tab out.
How often should it run?
Weekly suits most accounts. Set the frequency on the Scripts page in Google Ads.
Does the script need access to my Google account?
Google Ads asks you to authorize the script the first time it runs. That grant is between you and Google, inside your own account. Parallel AI receives nothing.
Google Ads is a trademark of Google LLC. Parallel AI is not affiliated with or endorsed by Google.
Read Shopping performance across every account
Connect Google Ads and Parallel AI reads product performance across your connected accounts, sets it beside bids, budgets and campaign structure, and writes the findings to a Sheet.
Starter $20, Pro $60 and Max $200 a month
You add a card to start the trial, then connect Google Ads.