How to Stop Advertising Out-of-Stock Products Automatically
Stop Advertising Products You Cannot Sell
Every e-commerce business has experienced it: a product sells faster than expected, stock dwindles to single digits, yet paid ads keep driving traffic to the product page. Customers click, land on an out-of-stock notice, and leave frustrated. The business pays for the click, loses the potential customer, and damages brand trust in one swift motion. Multiply that across dozens or hundreds of SKUs and the wasted ad spend becomes a serious drag on profitability.
The root problem is a disconnect between your inventory management system and your advertising platforms. Stock levels change by the minute, but campaign managers typically review and update ads once or twice a day at best. That gap is where money leaks. Inventory-based advertising automation closes it by letting your stock data drive your campaigns on a schedule you set — as often as every hour — pausing ads once a product drops below a safe threshold and re-enabling them once replenishment arrives.
Why This Approach Works
Traditional campaign management treats advertising and fulfilment as separate concerns. A media buyer sets budgets and targeting, while the warehouse team manages stock. The only link between the two is a manual check, a spreadsheet export, or a delayed feed update. Inventory-based ad automation removes the human bottleneck entirely.
When your inventory platform pushes stock-level data to AdTrigger via webhook, your rules are checked against the latest values on the interval you choose — as often as hourly. If a SKU is below your defined threshold at that check, the corresponding campaign is paused. When stock is replenished and the count is back at or above that threshold, the same rule switches the campaign back on automatically at the next check. This means every pound or dollar of ad spend is directed at products you can actually fulfil.
The business logic is straightforward: do not pay for traffic you cannot convert. By aligning ad visibility with stock availability, you protect your return on ad spend, reduce customer frustration, and free your team from the tedious cycle of manually toggling campaigns.
How to Set This Up in AdTrigger
Setting up inventory-driven ad automation takes just a few minutes. Here is the step-by-step process:
Step 1: Create a Data Source
Log into AdTrigger and navigate to Data Sources. Click Create Data Source and give it a descriptive name such as "Shopify Inventory" or "WMS Stock Feed". Select Custom Webhook as the source type.
Step 2: Define Your Field Schema
Define the fields your webhook payload will contain. For inventory management, you will typically need:
- product_sku (string) — the unique product identifier
- stock_count (number) — current available inventory
- status (string) — a status label such as "in_stock", "low_stock", or "out_of_stock"
Step 3: Get Your Webhook URL and API Key
Once the data source is created, AdTrigger generates a unique webhook URL and an API key. Copy both. The API key is used as a Bearer token in the Authorization header of every request, ensuring only your systems can push data to this endpoint.
Step 4: POST Data from Your Inventory System
Configure your inventory platform, warehouse management system, or a simple cron job to send an HTTP POST request to the webhook URL whenever stock levels change. Any system that can make an HTTP request can be the trigger — Shopify webhooks, WooCommerce hooks, a custom script polling your ERP, or even a Zapier automation.
Step 5: Build Your Rules
Navigate to Rules and create a new rule linked to your inventory data source. Set conditions using the numeric comparison operators:
- Pause condition:
stock_countis less than (lt)10, with the action set to pause
That one rule does both jobs. While stock is below 10 it keeps the campaign paused, and once stock is 10 or more again it switches the campaign back on. Do not add a second enable rule for the same campaign: two rules on one campaign each try to set it to their own answer, and they undo each other.
You can also combine conditions using AND logic. For example, pause only when stock_count < 10 AND status eq "low_stock" for extra safety. Each rule targets one Google Ads or Meta Ads campaign (or ad group), so create one rule for each campaign that promotes the relevant products.
Example Webhook Payload
Here is the JSON your inventory system would POST to the AdTrigger webhook endpoint:
POST https://api.adtrigger.io/webhooks/<your-source-id>
Authorization: Bearer <your-api-key>
Content-Type: application/json
{
"product_sku": "UMBRELLA-001",
"stock_count": 7,
"status": "low_stock"
}When AdTrigger receives this payload, it evaluates the stock_count value of 7 against your rule. Since 7 is less than 10, the associated campaign is paused. Later, when your warehouse processes a restock and sends a payload with stock_count: 120 and status: "in_stock", the condition is no longer true, so the same rule re-enables the campaign automatically.
Maximising Your Return on Ad Spend
Connecting inventory data to your ad campaigns unlocks several optimisation strategies beyond simple pause-and-enable logic:
- Run an extra campaign when stock is deep: Webhook rules pause and enable; they do not change budgets. To push harder when you have plenty of stock, keep a second campaign for the product with its own rule that enables it while stock is above 200 units. The same rule pauses it once stock falls to 200 or below. Your main campaign keeps running until its low-stock rule pauses it.
- Separate rules per product tier: High-margin products might warrant advertising down to the last 5 units, while low-margin items should pause at 20. Create different rules for different product categories.
- Send updates on a schedule as a safety net: AdTrigger acts on the most recent payload you sent and keeps that value until a new one arrives. If your inventory system stops sending updates, a campaign can stay paused on old stock data. Send the current stock level on a regular schedule, not only when it changes, and check the audit trail if a product has been paused for longer than expected.
- Review the audit trail weekly: AdTrigger logs every action it takes. Review the audit trail to spot patterns — if certain products are constantly toggling, it may indicate a supply chain issue worth addressing upstream.
- Align with seasonal demand: Adjust your stock thresholds before peak periods like Black Friday or holiday sales when you expect faster sell-through rates.
Common Pitfalls to Avoid
- Adding a second rule to switch the campaign back on: A pause rule already re-enables its campaign when the condition stops being true. A separate enable rule on the same campaign (for example, enable above 50) would disagree with it whenever stock is between 10 and 50, and the two would keep undoing each other. Use one rule per campaign.
- Forgetting to include the product identifier: If you manage multiple products, ensure your payload includes a field like
product_skuso you can target rules at specific campaigns rather than pausing everything. - Not testing with a staging campaign first: Before connecting your live campaigns, test the webhook integration with a low-budget test campaign to confirm the payload format and rule logic work as expected.
- Ignoring restock lead times: If it takes three days to restock a product, your pause threshold should account for how many units you sell in three days, not just a static number.
- Forgetting the campaign budget itself: Webhook rules pause and enable but never change budgets. Set each campaign's daily budget in Google Ads or Meta Ads so that when a rule enables it, it spends within sensible limits.
The Bottom Line
Inventory-based ad automation is one of the highest-impact optimisations an e-commerce business can make. Every click on an out-of-stock product is money wasted and a customer disappointed. By connecting your inventory system to AdTrigger via a simple webhook, you ensure that ad spend flows only to products you can actually sell. The setup takes minutes, the integration works with any platform that can make an HTTP POST request, and the result is a measurable improvement in ROAS and customer experience. Available on the Enterprise plan, this is the kind of automation that pays for itself within the first week.
Ready to automate this?
Set up this exact automation in AdTrigger — no code, no manual monitoring, just rules that act on real-time data.
Start FreeRelated Guides
Custom Webhooks
How Recruitment Agencies Can Pause Job Ads When Positions Are Filled
Read guide
Custom Webhooks
How Estate Agents Can Stop Advertising Properties Under Offer
Read guide
Custom Webhooks
How Subscription Businesses Can Pause Ads When Nearing Capacity
Read guide
Custom Webhooks
How Independent Brokers Can Run Ads Only While Rates Are Competitive
Read guide