Free Script

Monitor Your Best Sellersin Google Merchant Center

Did you know 10% of your products generate 80% of your revenue? Protect your top performers with our free automated monitoring script.

The Problem You're Facing

Your best sellers get disapproved without you knowing

Your conversions drop suddenly

You lose sales for hours or days

Google Ads interface showing ineligible products in Merchant Center

Our Solution: An Automatic Guardian for Your Products

A Google Ads script that quietly monitors your important products 24/7

Continuous Monitoring

Automatically checks approval status and availability of your top products

Instant Alerts

Receive detailed emails with product title, link and solution when issues are detected

Time Saver

No more manual monitoring - focus on growing your business

Ready to protect your revenue?

Let our experts set up this script for you in 30 minutes

How This Script Works

When a best seller gets disapproved or goes out of stock in Merchant Center, your conversions drop... often without you realizing it immediately.

Verifies they're still approved for Shopping
Checks their availability (stock)
Sends detailed email if issues are found
Apps Script editor showing product monitoring code

Setup in 5 Simple Steps

1
Add the script to your Google Ads account

The script can be added from a Google Ads account (MCC or individual): Tools → Bulk actions → Scripts, then paste the code.

2
Customize settings

At the beginning of the script, modify: EMAIL – alert recipient address, SUBJECT – email subject, merchants – list of Merchant Center accounts and their productIds

ProductId format: online:language:country:ID (ex. online:en:UK:123456)

3
Enable required API

Enable Shopping Content API via Advanced APIs in the editor

Enabling Shopping Content API in Apps Script editor

4
Authorize the script

Click 'Authorize' to grant permissions to the script

5
Schedule execution

In settings, choose hourly execution to be alerted quickly

COMPLETE SCRIPT: BEST SELLERS MONITORING

📜JavaScript code - ready to copy-paste. Script created by Hana Kobzová - ppcnewsfeed.com - Adapted by RedCorp Agency

/**
 * Best Sellers Monitoring Script for Google Merchant Center
 * Author: Hana Kobzová
 * Website: https://ppcnewsfeed.com/
 * Adapted by: RedCorp Agency
 *
 * Description:
 * This Google Ads script checks selected products across one or more Google Merchant Center accounts.
 * It flags products that are either:
 * - Not approved for the "Shopping" destination
 * - Marked as not in stock
 *
 * When issues are found, the script sends an email alert.
 *
 * Instructions:
 * - Can be run from an MCC Google Ads account or an individual account
 * - Shopping Content API under Advanced APIs must be enabled
 * - Recommended frequency: Hourly
 */

var EMAIL = "you@example.com"; // Replace with your email address
var SUBJECT = "[Script Alert] Best sellers not eligible for Shopping";

function main() {
  var merchants = [ // This example checks two Merchant Center accounts
    {
      merchantId: "12345678", // Replace with your Merchant Center ID
      productIds: [
        "online:en:UK:111111", // Add product IDs you want to monitor
        "online:en:UK:222222"
      ]
    },
    {
      merchantId: "87654321", // Replace with another Merchant Center ID if needed
      productIds: [
        "online:en:UK:333333"
      ]
    }
  ];
  
  for (var i = 0; i < merchants.length; i++) {
    var merchant = merchants[i];
    checkStatus(merchant.merchantId, merchant.productIds);
  }
}

function checkStatus(merchantId, productIds) {
  var badStatus = [];
  
  for (var i = 0; i < productIds.length; i++) {
    var productId = productIds[i];
    
    try {
      var status = ShoppingContent.Productstatuses.get(merchantId, productId);
      var product = ShoppingContent.Products.get(merchantId, productId);
      var availability = product.availability || "Unknown";
      var title = status.title || "Unknown title";
      var link = status.link || "No link available";
      var destinationStatuses = status.destinationStatuses || [];
      var itemIssues = status.itemLevelIssues || [];
      var disapproved = false;
      
      if (availability.toLowerCase() !== "in stock") {
        Logger.log("Product " + productId + " is out of stock.");
        badStatus.push({
          id: productId,
          title: title,
          link: link,
          reason: "<strong style='color:red'>" + availability + "</strong>"
        });
      }
      
      for (var j = 0; j < destinationStatuses.length; j++) {
        var entry = destinationStatuses[j];
        if (entry.destination === 'Shopping') {
          if (entry.hasOwnProperty('disapprovedCountries')) {
            disapproved = true;
            break;
          }
        }
      }
      
      if (disapproved) {
        Logger.log("Product " + productId + " is NOT APPROVED in Shopping.");
        var reasons = [];
        var seen = {};
        
        for (var k = 0; k < itemIssues.length; k++) {
          var reason = itemIssues[k].description || "Unknown reason";
          var doc = itemIssues[k].documentation || "";
          if (!seen[reason]) {
            seen[reason] = true;
            reasons.push("<strong style='color:red'>" + reason + "</strong>" + 
                        (doc ? " <a href='" + doc + "'>(documentation)</a>" : ""));
          }
        }
        
        badStatus.push({
          id: productId,
          title: title,
          link: link,
          reason: reasons.length > 0 ? reasons.join(", ") : "Unknown reason"
        });
      }
    } catch (e) {
      Logger.log("Error retrieving product " + productId + ": " + e.message);
    }
  }
  
  if (badStatus.length > 0) {
    var website = ShoppingContent.Accounts.get(merchantId, merchantId).websiteUrl || "Unknown website";
    sendEmail(badStatus, website);
  }
}

function sendEmail(products, websiteUrl) {
  var output = products.map(function(p) {
    return "<p><strong>ID:</strong> " + p.id +
           "<br><strong>Title:</strong> " + p.title +
           "<br><strong>Link:</strong> <a href='" + p.link + "'>" + p.link + "</a>" +
           "<br><strong>Reason(s):</strong> " + p.reason +
           "</p>";
  }).join("<hr>");
  
  var html = [
    "<html>",
    "<body>",
    "<p>" + SUBJECT + "</p>",
    "<p>Merchant website: " + websiteUrl + "</p>",
    "<p>-------------</p>",
    output,
    "</body>",
    "</html>"
  ];
  
  MailApp.sendEmail(EMAIL, SUBJECT + " - " + websiteUrl, "", { 
    htmlBody: html.join("\n") 
  });
  Logger.log("Email sent.");
}

Expert Tips & Advice

Which products to monitor?

  • • Your top 20% products generating 80% of revenue
  • • New products in launch phase
  • • Promotional products
  • • Seasonal products

Advanced optimizations

  • • Configure Slack alerts in addition to email
  • • Add a dashboard for tracking
  • • Integrate with existing BI tools
  • • Automate fixes for certain issues

Common mistakes

  • • Not monitoring frequently enough (minimum hourly)
  • • Forgetting to enable Shopping Content API
  • • Incorrect Product ID format
  • • Not testing email delivery first

Complementary tools

  • • Google Merchant Center API
  • • Google Ads Scripts
  • • Google Analytics 4
  • • Zapier for automation

Ready to protect your revenue today?

Our RedCorp Agency experts can set up this script for you in 30 minutes and show you how to optimize it for your business.

Questions? Need help?

manager@redcorpagency.com