Measurement-first Google & YouTube for 8 & 9-figure brands

10 Google Ads Scripts for Ecommerce

10 Google Ads Scripts for Ecommerce: Automate Shopping, PMax & Reporting

If you’re looking for Google Ads scripts for ecommerce that you can use in your campaigns, there are three primary areas to focus on: automating repetitive checks, surfacing anomalies, and supporting decisions.

With the right Google Ads scripts in place, you can catch issues that affect your sales and ad spend before they become costly. For example, a script can alert you when your ads lead to broken product pages or when your campaigns are spending too much of your monthly budget.

However, Google Ads scripts can’t access every Performance Max detail, and they can’t calculate actual profitability without reliable product cost data.  That’s why before you install one, check what it can actually do and what data it needs.

We’ve rounded up 10 publicly available Google Ads scripts that can help you manage your ecommerce campaigns. We’ll explain how each one works and what you need to know before using it.

The Best Google Ads Scripts for Ecommerce at a Glance

The best Google Ads scripts for ecommerce address specific campaign problems, from monitoring ad spend to identifying opportunities in product-level performance. Use the table below to compare what each script does and find which ones are most relevant to your account.

We’ve classified the scripts into three modes based on what they do:

ScriptMain use caseData requiredRecommended mode
1. Google Link CheckerFind broken ad landing-page URLsDestination URLs and HTTP responsesAlert
2. Account Anomaly DetectorCatch unusual performance changesCurrent and historical account dataAlert
3. Account Summary ReportReview overall advertising performanceAccount performance dataAnalyze
4. Google Ads Account AuditIdentify account issues and potential improvementsCampaign performance and account settingsRecommend
5. PMax Asset Group Performance AnalyzerCompare Performance Max asset group resultsPMax reporting dataAnalyze
6. N-Gram Search Query AnalyzerFind recurring search-term patternsSearch-term performance dataAnalyze
7. Monthly Budget Pacing ReportFlag campaigns spending above or below planCampaign budgets and spending dataAlert
8. Ecommerce Performance DashboardReview Shopping and PMax product performanceProduct-level advertising dataAnalyze
9. Geo Waste FinderIdentify locations that may be wasting ad spendGeographic performance dataRecommend
10. Custom Campaign Report BuilderBuild customized campaign performance reportsSupported Google Ads reporting fieldsAnalyze

Before using these scripts: These publicly available scripts may require adjustments for your Google Ads account. Review the code and confirm that the required data and permissions are available before running them. Use Google’s Preview feature where supported and compare the results with your account data before scheduling regular execution.

1. Google Link Checker

Recommended mode: Alert

When your store removes a product or changes its URL, your Google Ads may still point to the old page. Shoppers who click those ads could land on a 404 error page, wasting ad spend and losing potential sales. For ecommerce stores with frequent product updates or short promotions, we’d recommend making this a priority to monitor.

Get the script here: Google Link Checker

How it works: The script checks the URLs on your ads and keywords, including sitelinks, for errors such as 404 or 500 responses. It records broken links in Google Sheets and emails you when it finds issues.

How to use it:

  • Get the script and copy Google’s spreadsheet template from the link above.
  • Enter your spreadsheet URL and notification email.
  • Choose which types of URLs to check and which HTTP responses count as errors.
  • Schedule hourly execution and set how often a full check should begin.


Risks to consider:
Temporary server errors or bot protection can make working pages appear broken. The script also doesn’t check the product URLs in your Merchant Center feed, so Shopping and Performance Max listings fall outside its scope. Verify flagged URLs before making changes to your campaigns.

2. Account Anomaly Detector

Recommended mode: Alert

A sudden drop in conversions can go unnoticed when you’re managing multiple Shopping and Performance Max campaigns. By the time you review your reports, you may have already lost several days of sales. We’d recommend automating performance monitoring so your team can investigate problems sooner instead of discovering them after they’ve become costly.

Get the script here: Google Account Anomaly Detector

How it works: The script compares today’s account performance against the same weekday over previous weeks. You choose how many weeks to compare, and Google’s example uses 26. It could send an email when clicks or conversions fall below your chosen thresholds, or when spending rises unusually high.

How to use it:

  • Get the script and make a copy of Google’s spreadsheet template.
  • Add the spreadsheet URL to the script.
  • Enter your notification email and set the alert thresholds in the spreadsheet.
  • Schedule hourly checks, as Google recommends.

Risks to consider: A drop in reported conversions doesn’t always mean campaign performance has declined. Conversion delays or seasonal demand can trigger misleading alerts. Review the findings against your store’s sales data before making changes.

3. Account Summary Report

Recommended mode: Analyze

If your ecommerce brand runs several Google Ads campaigns, an automated account summary brings your daily ad spend and traffic data into one place. It helps you track performance over time, so you don’t have to pull reports manually every morning.

Get the script here: Google Account Summary Report

How it works: The script pulls yesterday’s account performance into Google Sheets and can email you a daily summary. It tracks metrics such as ad spend and clicks, with charts showing performance over time.

How to use it:

  • Copy Google’s script and spreadsheet template from the link above.
  • Add your spreadsheet URL to the script’s configuration.
  • Enter your email address in the spreadsheet to receive reports.
  • Schedule it to run daily after 3 AM, as Google advises to account for reporting delays.


Risks to consider:
The default report doesn’t include conversions or ROAS, so it won’t tell you whether your ecommerce campaigns are profitable. You’ll need additional reporting for that.

4. Google Ads Account Audit

Recommended mode: Recommend

When Shopping and Performance Max run alongside Search, reviewing each campaign type separately can make account-wide problems harder to spot. An audit script can help you identify where performance falls short of your targets and which areas deserve a closer look.

Get the script here: Google Ads Account Audit on GitHub

How it works: The script analyzes Google Ads performance using your chosen benchmarks and generates a Google Sheets report. It includes Shopping product performance and PMax asset group analysis, along with recommendations based on metrics such as ROAS and CPA.

How to use it:

  • Copy the script from GitHub and create a dedicated Google Sheet for its reports.
  • Enter your Spreadsheet ID in SPREADSHEET_ID.
  • Update the default 2025 reporting dates to your preferred period.
  • Adjust the ROAS targets and other performance thresholds to match your account.
  • Run the script and review its recommendations before making changes.


Risks to consider:
The recommendations depend on the thresholds you set, so a single ROAS target may not suit products with different margins. The script also rebuilds spreadsheet tabs, so use a dedicated file to avoid losing existing data.

5. PMax Asset Group Performance Analyzer

A Performance Max campaign can hit its ROAS target while some asset groups deliver much weaker results. Looking at asset group performance separately can help you identify which ones deserve closer attention instead of relying on the campaign average.

Get the script here: PMax Asset Group Performance Analyzer on GitHub

How it works: The script pulls available asset group performance data into Google Sheets, such as conversions and ROAS. It also emails a summary highlighting groups that fall above or below your chosen performance thresholds.

How to use it:

  • Copy the script from GitHub into Google Ads and create a dedicated Google Sheet for the results.
  • Update the spreadsheet URL and notification email in the script’s settings.
  • Adjust the reporting period and performance thresholds to suit your account.
  • Preview the script and check whether the report contains the expected asset group data before scheduling it.


Risks to consider:
The default thresholds (e.g., a ROAS below 1 marks a low performer) may not reflect your products’ profit margins. The script also falls back to campaign-level data if asset group data can’t be retrieved. Check which data the report actually contains before making optimization decisions.

6. N-Gram Search Query Analyzer

Recommended mode: Analyze

Some wasted ad spend is hard to spot because it’s spread across dozens of different search queries, with no single expensive keyword to flag. An n-gram analyzer can help you uncover recurring words or phrases that may be attracting the wrong shoppers.This is particularly useful if you run an ecommerce PPC account with large search-term reports.

Get the script here: N-Gram Search Query Analyzer on GitHub

How it works: The script groups repeated words and phrases from search queries and calculates their combined performance, such as conversions and ROAS. It exports the findings to Google Sheets and flags potential keyword opportunities or negative keyword candidates.

How to use it:

  • Copy the script from GitHub and create a Google Sheet for the results.
  • Add your spreadsheet URL under SPREADSHEET_URL.
  • Adjust the reporting period and minimum impressions or clicks required for analysis.
  • Preview the script to check its results before scheduling weekly analysis.


Risks to consider:
A word that shows up in poor searches isn’t always a bad keyword, and one search can count toward several phrases. Performance Max queries may also be missing, since Google reports them separately. Review the underlying searches before adding exclusions.

7. Monthly Budget Pacing Script

Recommended mode: Alert

Ecommerce campaigns can spend faster than planned during promotions or seasonal sales. A budget pacing script can warn you when your account is using up its monthly budget too quickly, giving you time to review spending before it exceeds your target.

Get the script here: Monthly Budget Pacing Script

How it works: The script totals your account’s spending for the current month and compares it against your budget. It sends an email if you’ve spent at least 50% within the first 10 days, followed by alerts at 90% and 100%. It also uses Google Sheets to track which alerts have already been sent.

How to use it:

  • Copy the script from the link above into Google Ads.
  • Enter your monthly budget under config.budget.
  • Add your notification emails and a copy of the Google Sheets email tracker.
  • Preview the script to check its results before scheduling it to run daily.


Risks to consider:
The script only tracks total account spend, so it won’t show which campaigns are overspending or forecast your month-end spend. The code also formats dates in GMT, so check that its month boundaries match your account’s time zone.

8. Ecommerce Performance Dashboard

Recommended mode: Analyze

A campaign can report strong ROAS while individual products consume ad spend without generating enough sales. For ecommerce brands with large catalogs, this is where product-level reporting becomes useful. The Ecommerce Performance Dashboard helps you see how individual products perform across Shopping and Performance Max, rather than relying on campaign averages.

Get the script here: Ecommerce Performance Dashboard on GitHub

How it works: The script pulls Google Ads data into a multi-tab Google Sheets dashboard. It includes product-level performance, ROAS, and budget pacing reports. It also offers a conversion-lag forecast to help account for purchases that take longer to appear in Google Ads.

How to use it:

  • Copy the script from GitHub and create a dedicated Google Sheet.
  • Enter your spreadsheet ID under SPREADSHEET_ID.
  • Update REPORT_START_DATE and REPORT_END_DATE to your preferred reporting period.
  • Enable the reporting tabs you need, then run the script and review the results before scheduling it.


Risks to consider:
The default reporting dates end in December 2025, so update them before your first run. The script also clears and rebuilds report tabs, so use a separate Sheet. Its ROAS figures don’t account for your product margins.

9. Geo Waste Finder

Recommended mode: Recommend

Some locations can consume a large share of your Google Ads budget without bringing in enough sales. This is worth investigating if your ecommerce brand advertises nationwide, since performance can vary significantly between regions. Geo Waste Finder can help identify locations that deserve closer attention before you adjust your geographic targeting.

Get the script here: Geo Waste Finder on The SEM Dispatch

How it works: The script compares each location’s share of ad spend against its share of conversions over the past 30 days. It flags locations where spending exceeds your chosen threshold without a matching share of conversions. The results go into Google Sheets, with optional email alerts.

How to use it:

  • Copy the script from The SEM Dispatch and create a Google Sheet for the report.
  • Add your spreadsheet URL under SHEET_URL.
  • Set MIN_SPEND to exclude locations with too little data.
  • Adjust WASTE_THRESHOLD to control how large the gap must be before a location gets flagged.
  • Run the script to review the results before scheduling weekly checks.


Risks to consider:
A location with fewer conversions isn’t automatically wasting money. The script flags by conversion count alone, so a region with fewer but larger orders can still get flagged. Check each flagged location’s sales value before you exclude it.

10. Google Ad Performance Report

Recommended mode: Analyze

Your ecommerce ads might be getting clicks, but which headlines and landing pages are attracting the most attention? Google’s Ad Performance Report helps you compare ad creative performance, making it easier to identify patterns worth considering when updating your campaigns. The report also covers video ads, which helps if you run YouTube ads for your store.

Get the script here: Google Ad Performance Report

How it works: The script analyzes the previous week’s ad performance and creates a Google Sheets report with charts comparing headlines and final URLs. It includes impressions, clicks, CTR, and ad spend. You can also receive the report by email.

How to use it:

  • Get the script and copy Google’s spreadsheet template.
  • Enter the spreadsheet URL under spreadsheet_url.
  • Add your email address under recipient_emails.
  • Schedule the script to run every Monday for the previous week’s results.


Risks to consider:
The report doesn’t include conversions or ROAS, so a headline generating more clicks isn’t necessarily driving more sales. It also isn’t a product-level report for Shopping or Performance Max.

Google Ads Scripts vs. Built-In Automation Tools

Google Ads already has several automation features, so you don’t always need a script to save time. However, scripts can give you more control over what gets monitored and how performance data is analyzed. The best approach is to use built-in tools for common tasks and Google Ads scripts when you need more customized reporting or monitoring.

Here’s how they compare for ecommerce advertisers.

Option

Best suited to

Main limitation

Google Ads scripts

Custom checks and reports

Requires code, permissions, testing, and maintenance

Automated rules

Scheduled changes based on set conditions

Limited to the conditions and actions Google provides

Google Ads Editor

Bulk edits and campaign builds

Doesn’t provide scheduled monitoring

Merchant Center tools

Product issues and eligibility checks

Limited to Merchant Center’s native features

Inventory or feed platform

Stock syncing and product data management

Depends on integration quality and data freshness

BI and reporting tools

Cross-source analysis and dashboards

Requires additional setup and generally doesn’t make account changes

Use these guidelines to choose the right tool:

How to Install, Test, and Maintain Google Ads Scripts Safely

You can install a Google Ads script by pasting its code into the Scripts page of your account, then previewing it before you let it run on a schedule. Follow these steps to add a script:

  1. Open Tools → Bulk actions → Scripts.
  2. Click the plus button and choose New script.
  3. Paste the code and update its settings, such as your Sheet URL and email address.
  4. Click Authorize after reviewing the permissions the script requests.
  5. Click Preview and check the logs and any spreadsheet output.
  6. Click Run, then set a schedule by clicking the pencil icon in the Frequency column.

Standard Google Ads scripts stop after 30 minutes, although certain manager-account scripts can run longer. Any changes made before a script times out remain in place. This makes it important to review the code and preview each script before running it.

Keep in mind that Preview doesn’t prevent changes to external services. A script can still send emails or modify Google Sheets while you’re testing it.

Before you schedule a public script, check these points:

  • What it changes: Read the setup notes to see whether the script only reports or also edits your account or Sheets. Some scripts on this list clear and rebuild spreadsheet tabs.
  • Dates and settings: Update any fixed date ranges and thresholds to match your account.
  • Output accuracy: Compare a few numbers in the script’s output with the same report in Google Ads.
  • Scope: Start with one account before rolling a script out across others.


Once a script is running, these habits help keep it reliable:

  • Owner and schedule: Record who installed the script, when it runs, and where its reports go.
  • Run history: Check for errors, especially after restructuring campaigns.
  • Google updates: Recheck the script when Google changes its reporting fields or APIs, since some published scripts still use older versions.

Can AI Help You Write Google Ads Scripts?

Yes, AI tools like ChatGPT and Claude can help you write Google Ads scripts without advanced coding skills. They can even explain errors or modify an existing script to fit your needs.

However, AI-generated code may use outdated methods or make unintended changes to your campaigns. Here’s how to use it safely:

  1. Define the task: Explain what you want the script to do, such as finding Shopping products that spend money without generating sales.

     

  2. Check the requirements: Ask the AI to list the data and permissions the script needs.

     

  3. Review the code: Verify it against the Google Ads Scripts documentation.

     

  4. Test the output: Use Preview and compare the results with your Google Ads reports. Preview still sends emails and updates Google Sheets, so test with a spare Sheet.

     

  5. Check before scheduling: Confirm that the script handles missing data and won’t make unwanted account changes.


Keep credentials and sensitive customer data out of AI tools. We’d recommend using AI only to customize an existing script from a reliable source, since a proven starting point leaves less room for errors.

Which Ecommerce Google Ads Script Should You Start With?

The best Google Ads script to start with is the one that targets your most pressing problem. We’d recommend tackling one recurring issue first and checking the results against your Google Ads data before you add more automation.

Use this list to pick a starting point:

Go Beyond Google Ads Scripts to Grow Profitable Ecommerce Sales

The right set of Google Ads scripts for your ecommerce brand can help you catch wasted spend and spot performance changes before they get expensive. But a script can only flag what it’s built to check, and it can’t decide what to change next. For your scripts to pay off, you need accurate conversion tracking and a campaign structure built around your products and margins.

If you want to find the biggest opportunities in your account beyond what Google Ads scripts can do, we invite you to book a Google Ads audit call with our team. As a Google Premier Partner, we’ll take a closer look at your campaigns and show you where your advertising budget could be working harder to generate more profitable sales.

Frequently Asked Questions

What are Google Ads scripts?

Google Ads scripts are JavaScript programs that run inside your Google Ads account to automate reporting and account changes. Google hosts them for free, and you can schedule them hourly or daily. For ecommerce brands, they’re most useful for catching broken product pages and tracking Shopping and Performance Max results. Preview each script before you schedule it.

Yes, Google Ads scripts are free to use, and Google doesn’t charge you to run them inside your account. Many ready-made scripts are also available for free. However, some third-party scripts and external services cost money. You’ll also need to account for the time spent testing and maintaining them.

Yes, a Google Ads script can pause ads for out-of-stock products by scanning landing pages for text like “Sold out” or by checking a stock file. This works best for Search ads, since Shopping and Performance Max rely on your Merchant Center feed. Sold-out text elsewhere on a page can trigger false pauses, so test with Preview first.

Yes, Google Ads scripts work with Performance Max, though support is partial. Scripts can read PMax campaign and asset group results and make basic changes, such as pausing a campaign. Some details stay hidden, such as every search term or placement behind your spend. Check Google’s Performance Max scripts guide before you build a custom report.

No, a script can’t improve ROAS on its own, because it only follows the rules and data you give it. Scripts help indirectly by catching waste sooner, such as clicks on broken pages or spend on search terms that don’t convert. Smart Bidding handles auction-level bids, so let scripts act as guardrails and check your conversion tracking first.

Want to scale your Business?

Book a call with Nate Schneider to explore how Google and YouTube ads can drive scalable, measurable growth.

How Google AI Mode ads work for ecommerce: which campaigns qualify, where ads are live, what they cost, and the feed fixes that matter.
Compare YouTube Shorts and in-stream ads for ecommerce. Learn when to use each format, test performance, and measure sales, CPA and ROAS.
How long does the Google Ads learning phase take? Learn when to wait, when to optimize, and which campaign changes can affect performance.

Share this:

Facebook
X

Blog Posts

You May Also Like

Google AI Mode Shopping Ads Guide
How Google AI Mode ads work for ecommerce: which campaigns qualify, where ads are live, what they cost, and the feed fixes that matter.
YouTube Shorts Ads vs. In-Stream Ads
Compare YouTube Shorts and in-stream ads for ecommerce. Learn when to use each format, test performance, and measure sales, CPA and ROAS.
Google Ads Learning Phase Explained
How long does the Google Ads learning phase take? Learn when to wait, when to optimize, and which campaign changes can affect performance.
Loading...