DEV Community

Vhub Systems
Vhub Systems

Posted on

My Competitor Was Out of Stock for Two Weeks. I Found Out on Day 9. I Left $20,000 on the Table.

monitor competitor out of stock shopify automation | competitor inventory alert ecommerce n8n | detect competitor out of stock automatically


There's a moment every Shopify store owner eventually has — you're reviewing last month's analytics, and you notice a SKU that performed three times its normal revenue for eight days straight. You dig in. You check ad spend, you check email send history, you check if anything changed on the product page. Nothing. Then you check your competitors. And there it is: their flagship product showed "Out of Stock" for ten days. A ten-day demand vacuum. And you spent the whole time running standard bids.

"My competitor went out of stock on their main product for two weeks in July. I found out on day 9 when I noticed my sales were unusually high. If I'd known on day 1, I would have immediately pushed Google Shopping and sent an email campaign. I left $20,000 on the table."

That's not a niche experience. It's one of the most common and expensive missed opportunities in Shopify e-commerce — and it's structural. The monitoring infrastructure doesn't exist at an affordable price point. So most merchants discover competitor out-of-stock events the same way: retrospectively, when the revenue spike shows up in their analytics days after the window opened.

This article explains why every existing tool misses this problem, then shows you the exact architecture — Apify + n8n + Airtable + Slack — that fires a demand capture alert within 4–6 hours of a competitor going out of stock.


Why Prisync Doesn't Solve This

Prisync is a legitimate price monitoring tool. If you're running a large operation tracking hundreds of competitor SKUs across multiple channels for price changes, it earns its keep. But its pricing — $99 to $399/month — reflects a use case that's fundamentally different from what a Shopify merchant needs for OOS monitoring.

Prisync tracks prices. Stock status monitoring on individual Shopify product pages is not its primary function. Its alert system sends email reports — not real-time Slack notifications with an action checklist attached. And even if you stretched it to cover availability monitoring, you'd be paying a $99/month enterprise price for a problem that costs $0.50/month in Apify compute to solve.

The merchant monitoring 5–10 competitor product pages for the single signal that matters — "Add to Cart" vs. "Out of Stock" — doesn't need a price intelligence platform. They need a targeted OOS detector.


Why PriceSpy and Google Shopping Insights Don't Solve This

PriceSpy aggregates product prices from merchant feeds. It does not monitor individual Shopify product page availability. It can tell you what a product costs across a dozen merchants — it cannot tell you which of those merchants just ran out of inventory.

Google Shopping Insights surfaces aggregate search volume and impression data. It's useful for keyword trend analysis. It does not reveal when a specific competitor product moves from "Add to Cart" to "Sold Out." Neither tool provides a real-time alert when a specific competitor URL changes its stock status.

These tools are measuring market-level signals. You need a page-level signal — the exact moment the button text changes on one specific competitor product URL.


Why Google Alerts Don't Solve This

This is the one people try first. Set a Google Alert for "PawCool Direct cooling mat" and wait for the OOS signal to arrive in your inbox.

What actually arrives: blog posts, review roundups, Reddit threads, social shares, news mentions. The signal-to-noise ratio for inventory status detection is effectively zero. Google Alerts monitors the web for content mentioning a term — it does not check a product page's HTML for a CSS class change or button text swap.

"I've tried setting Google Alerts for my competitors but it's useless — I just get blog posts. I need something that actually checks their product pages and tells me when the 'Add to Cart' button disappears."

This is widely reported on r/entrepreneur and r/shopify. Merchants who try it abandon it within a few days. It's a brand mention aggregator masquerading as a monitoring tool.


Why Manual Checking Doesn't Solve This

The math is simple and brutal. A competitor's OOS window for typical physical goods averages 3–21 days. A merchant who checks competitor pages once a week will eventually catch it — but the peak demand capture window is the first 24–48 hours, when demand redirection is highest, the competitor hasn't yet expedited restocking, and Google Shopping CTR on available alternatives is spiking.

For a merchant running Google Shopping campaigns, the bid adjustment needs to happen within hours. A 30–50% bid increase on the primary category keyword during a competitor OOS event captures demand that was going to the competitor and now has nowhere to go. That demand doesn't wait for you to discover it on your weekly competitor check.

Every day of detection delay is lost revenue that doesn't recover when the competitor restocks. The window opens, peaks, and closes. You're either in it or you're not.

"I know this tactic works — every time a big competitor goes OOS in my niche, I can see it in my own conversion data 3 days later. But by then the competitor has already restocked or the demand has moved on. I need to know the same day it happens."


The Architecture: Apify + n8n + Airtable + Slack in Three Components

The system runs on three components. Total cost: $0.50–$2/month in Apify compute, plus the n8n and Airtable free tiers.

Component 1 — Product Page Availability Monitoring (Apify)

The detection layer uses apify/cheerio-scraper — a lightweight, fast scraper that parses static HTML. You configure it with an array of competitor product page URLs and the CSS selector or button text pattern that indicates OOS status. Most Shopify themes follow predictable patterns:

  • Dawn theme (Shopify default): <button disabled>Sold out</button> or the button[name="add"] disabled state
  • Debut theme: <button class="btn product-form__cart-submit btn--full">Sold out</button>
  • Prestige/Turbo: <span class="product-form__sold-out">Out of Stock</span>

The scraper runs every 4–6 hours on a schedule. Per URL it returns: url, availabilityStatus ("IN_STOCK" or "OUT_OF_STOCK"), pageTitle, scrapedAt. At 4-hour intervals across 10 competitor product pages, Apify compute cost is approximately $0.50–$1.50/month.

Component 2 — Status Transition Detection + Alert Logic (n8n)

The comparison layer runs in n8n. On each trigger cycle, the workflow receives the Apify scrape output and iterates through each URL. For each URL, it reads the stored current_status from an Airtable record and compares it against the newly scraped status.

Three outcomes:

  • Status unchanged: Log run timestamp to Airtable. No alert. Continue.
  • IN_STOCK → OUT_OF_STOCK: Route to OOS alert branch. High priority.
  • OUT_OF_STOCK → IN_STOCK: Route to restock alert branch. Window closing.

The n8n code node handling the comparison is simple:

const currentStatus = $input.item.json.availabilityStatus;
const storedStatus = $input.item.json.airtableCurrentStatus;
const transition = `${storedStatus}${currentStatus}`;
const alertType = (storedStatus !== currentStatus)
  ? (currentStatus === 'OUT_OF_STOCK' ? 'OOS_ALERT' : 'RESTOCK_ALERT')
  : 'NO_CHANGE';
return { ...($input.item.json), transition, alertType };
Enter fullscreen mode Exit fullscreen mode

After the alert branch executes, an Airtable Update node writes the new current_status and last_checked timestamp back to the competitor_products table.

Component 3 — Alert Delivery + Event Log (Slack + Airtable)

When the OOS transition fires, a Slack message arrives in your #oos-alerts channel within the next scheduled run window (maximum 4–6 hours from the moment the competitor's page changes):

🔴 COMPETITOR OUT OF STOCK — DEMAND CAPTURE WINDOW OPEN
Competitor: PawCool Direct ([COMPETITOR_DOMAIN])
Product: "Cooling Mat for Dogs — Large"
URL: [COMPETITOR_URL]
Status: IN_STOCK → OUT_OF_STOCK
Detected: 2026-03-31 08:04

⚡ Response checklist:
→ [1] Increase Google Shopping bid on "dog cooling mat" by 30–50%
→ [2] Activate sale: 10% off your Dog Cooling Mat (promo code: GRAB10)
→ [3] Send email/SMS to past buyers of adjacent SKUs
→ [4] Update collection page title/meta for SEO visibility
Enter fullscreen mode Exit fullscreen mode

Simultaneously, an Airtable Create Record node logs the transition to the oos_events table: competitor, product, URL, status_from, status_to, detected timestamp, and a window_end field that gets populated when the restock alert fires.

When the competitor restocks, a second Slack message closes the window:

⚠️ COMPETITOR RESTOCKED — Window closing.
PawCool Direct's "Cooling Mat for Dogs — Large" is back in stock.
Window duration: 11 days, 6 hours.
Action: Revert Google Shopping bids to baseline. Archive OOS event in Airtable.
Enter fullscreen mode Exit fullscreen mode

Step-by-Step Setup (~75 Minutes Total)

Step 1 — Build Your Competitor OOS Tracker in Airtable (15 minutes)

Create an Airtable base with two tables:

  • competitor_products: competitor_name, product_name, product_url, category, current_status [IN_STOCK/OUT_OF_STOCK], last_checked, oos_start_date, notes
  • oos_events (auto-populated by n8n): competitor, product, url, status_from, status_to, detected_timestamp, window_end, duration_hours

Populate competitor_products with 5–15 competitor product page URLs. Set initial current_status to IN_STOCK for all, or manually verify each and set correctly before activating the workflow. The first baseline check will confirm.

Step 2 — Identify OOS Selectors for Your Competitors' Shopify Themes (15 minutes)

Right-click a competitor's product page, open "Inspect Element," and locate the add-to-cart button area. You're looking for either a disabled button state or a specific class applied when the product is unavailable. The four most common Shopify themes (Dawn, Debut, Prestige, Turbo) each have consistent OOS selector patterns — the included selector reference sheet covers them.

Note the CSS selector or button text string for each competitor. You'll configure these in Apify in Step 3.

Step 3 — Configure the Apify Cheerio Scraper Task (10 minutes)

In Apify, create a new task using apify/cheerio-scraper. Set memory to 256MB. Configure:

  • startUrls: your array of competitor product page URLs
  • Page function: extract the availability signal using your configured CSS selector
  • Output fields: url, availabilityStatus ("IN_STOCK" or "OUT_OF_STOCK"), pageTitle, scrapedAt

Run the task manually once against one competitor URL to confirm the availability signal is captured correctly. Verify the availabilityStatus field returns the expected value before connecting n8n.

Step 4 — Build the Status Comparison Logic in n8n (20 minutes)

Create a new n8n workflow:

  1. Schedule Trigger: Every 4 hours
  2. Apify Run Task node: Trigger your scraper task, wait for completion, receive output
  3. Split In Batches: One URL per iteration
  4. Airtable Read node: Fetch current_status for this URL from competitor_products
  5. Code node: Compare scraped status vs. stored status, determine alertType
  6. IF node: Route to OOS alert branch, restock alert branch, or log-only branch
  7. Airtable Update node: Write new current_status and last_checked

The workflow is linear with a branch split at the IF node. Both alert branches converge on the Airtable event log.

Step 5 — Configure the Slack Alerts (10 minutes)

In the OOS alert branch, add a Slack node. Use the full message template from the architecture section above, with n8n expressions substituting {{$json.competitorName}}, {{$json.productName}}, {{$json.productUrl}}, and {{$now}} into the message body.

In the restock alert branch, configure the "Window closing" message with the window duration calculated from the Airtable oos_start_date field.

Connect your Slack workspace via OAuth in n8n credentials. Target the #oos-alerts channel.

Step 6 — Log OOS Events to Airtable and Activate (5 minutes)

In both alert branches, add Airtable Create Record nodes targeting the oos_events table. The OOS branch creates a new record with status_from = IN_STOCK, status_to = OUT_OF_STOCK, and detected_timestamp = now. The restock branch updates the existing open event record with window_end and calculates duration_hours.

Set the workflow to Active. Run it once manually to write the first status baseline to all competitor_products records. After the first run, check Airtable to confirm all records have been written. Check the Slack channel after the second scheduled run to confirm no false alerts are firing.

Total setup time: ~75 minutes.

Important scope note: This system monitors direct-to-consumer Shopify product page URLs only. Amazon, eBay, and other marketplace product pages have different HTML structures that require separate scraper configurations. This system also does not automatically adjust Google Ads bids — bid adjustment is a manual action triggered by the Slack alert.


What the System Delivers: A Sample Alert Sequence

You activate the system on a Tuesday. For the next 9 days, you're the only available option for buyers searching for "dog cooling mat" who land on the competitor's sold-out page. Your Google Shopping impression share on that keyword climbs. Conversion rate on your competing SKU rises.

Eleven days later:

⚠️ COMPETITOR RESTOCKED — Window closing.
PawCool Direct's "Cooling Mat for Dogs — Large" is back in stock.
Window duration: 11 days, 4 hours.
Action: Revert Google Shopping bids to baseline.
Enter fullscreen mode Exit fullscreen mode

You revert the bids. The Airtable event log now has a complete record of the window: start date, end date, 11.4-day duration. In the notes field you can log your estimated incremental revenue. Over time, that event log becomes a map of your niche's supply vulnerabilities — which competitors go OOS most frequently, on which products, and for how long.

That's competitive intelligence you can plan around, not just react to.


Get the Competitor Out-of-Stock Demand Capture System

The system is packaged as a ready-to-deploy bundle: n8n workflow JSON (import-ready, all nodes pre-configured), Apify cheerio-scraper config (URL list input, selector config, status field extraction), Airtable OOS event log template (competitor, product, status, window start, window end, duration, notes fields), demand capture response playbook PDF (8-step response checklist for the first 6 hours after OOS detection — Google Shopping bid adjustment, email/SMS template, collection page SEO update, ad creative reuse guide), and Shopify OOS selector reference sheet covering Dawn, Debut, Prestige, and Turbo themes.

Setup time is ~75 minutes. Running cost is ~$0.50–$2/month.

Competitor Out-of-Stock Demand Capture System — $29
→ [GUMROAD_URL]

Shopify Competitive Intelligence Pack — $39
Pain #233 (Competitor OOS Monitor) + Pain #229 (Competitor Price Change Alert) — monitor both inventory vacuums and pricing moves with two pre-built competitive intelligence systems.
→ [GUMROAD_URL]

This is for Shopify store owners competing in niches with 3–10 direct competitors, particularly in high-demand physical goods categories: pet supplies, outdoor gear, home goods, baby products, fitness equipment, supplements. Requires: n8n (self-hosted or cloud), Apify account (free tier covers 10 product URLs at 4-hour schedule for ~$0.50/month), Airtable (free tier sufficient). No coding required.


Pain Profile #233 | E-commerce | Severity: 8.0/10 | Article 52

Top comments (0)