/
/
Check Shopify stock behind every product in a Mailchimp campaign
For marketers and merchandisers who want to know if products a Mailchimp campaign promotes can still be bought in Shopify, by asking their AI assistant.
On this page
Connector
Connect Shopify, pick your AI tool and paste the prompt.
The problem
Your campaign may be sending shoppers to empty shelves
A campaign can send hundreds of shoppers to a product that is about to run out. Checking means pulling the clicked links, working out which product each points to and opening every variant in Shopify to read its stock and policy.
Without PopdockAI
- Pull the campaign's clicked links from Mailchimp
- Work out which product each link points to
- Open every variant in Shopify to read its stock
- Miss the variants that oversell at zero
With PopdockAI
- Product page links and their clicks are read from the campaign
- Links to the same product are merged
- Every variant's quantity, SKU and stock policy is read in Shopify
- Variants are marked out of stock, low or ok, and nothing is changed
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** For the Mailchimp campaign named `{campaign-name}`, find every Shopify product page it linked to, and flag any variant whose stock is at or below `{low-stock-threshold}` (default 5).
**Step 1: Campaign links in Mailchimp**
Call `mailchimp-get-campaign` with `title.contains` = `{campaign-name}`. If it matches more than one campaign, list them with `send-date` and stop. Note `campaign-id`, `title`, `status` and `send-date`. Then call `mailchimp-get-campaign-click` with `campaign-id` and `url.contains` = /products/. Keep `url`, `clicks` and `unique-clicks`.
**Step 2: Product handles**
From each URL take the path segment directly after /products/, dropping any query string, fragment or trailing slash; that is the Shopify product handle. Merge URLs that give the same handle and add their clicks.
**Step 3: Stock in Shopify**
For each handle, call `shopify-get-product` with `handle`. If nothing comes back, mark the link "no matching Shopify product". Otherwise note `product-id` and `title`, and call `shopify-get-product-variant` with `product-id`. For each variant note `title`, `sku`, `inventory-quantity`, `inventory-policy` and `price`.
**Step 4: Report**
A table of linked products sorted by clicks descending: product, clicks, then each variant with SKU, quantity and policy. Mark each variant **out of stock** (quantity 0 or less), **low** (at or below the threshold) or **ok**. Where `inventory-policy` is continue, note that the variant can still be bought while out of stock (oversell risk); where it is deny, note that buyers are being turned away. End with links that matched no product.
**Rules & Guidelines:**
* `mailchimp-*` tools are on the mailchimp server; `shopify-*` tools are on the shopify server.
* Read-only. Do NOT call `shopify-add-inventory-level`, `shopify-update-product`, `mailchimp-update-product`, `mailchimp-replicate-campaign` or any other add or update tool.
**Validation:**
* If the campaign has no product-page clicks, say so; if it has not been sent yet (no clicks at all), say that instead.
* Links to collections or other pages are not products; count them but do not look them up.Who it's for
One answer, three teams that use it
Inventory planners
Restock what the campaign is pushing
See which promoted variants are low or out, sorted by the clicks sending people to them.
Check Shopify stock for the products in the Winter Essentials campaign in Mailchimp and flag anything under 20.
Email marketers
Avoid promoting what you cannot sell
Check a campaign's products before or during the send, so you can swap a sold out item before it costs you clicks.
Are any products linked in our Holiday Gift Guide campaign in Mailchimp out of stock in Shopify?
Ecommerce managers
Know where you might oversell
Variants whose policy allows selling at zero are noted, so you can decide whether to stop orders or expedite stock.
For the Weekend Flash Sale campaign in Mailchimp, which Shopify variants are low and still allow overselling?
How it works
What PopdockAI does when you ask
You name the campaign, and your AI assistant maps its product links to Shopify and checks every variant. It only reads both systems.
01
Ask
You name the Mailchimp campaign and optionally a low stock threshold.
02
Read
It reads the campaign's product links and their clicks.
03
Check
It finds each product in Shopify and reads every variant's stock and policy.
04
Report
You get variants marked out of stock, low or ok, with overselling notes.
What PopdockAI provides
The tools behind the answer
Ready made tools for Shopify and one secure connection to your AI tool. No code, no exports.
mailchimp-get-campaign
mailchimp-get-campaign-click
shopify-get-product
shopify-get-product-variant
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
Stock problems caught before shoppers hit them
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
