Connectors

/

Shopify

/

Check Shopify stock for products in a Mailchimp campaign
Report
Cross-Connector

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.

Try PopdockAI free
Get a live demo
Check Shopify stock for products in a Mailchimp campaign
Do we have stock for the products in our Autumn Sale campaign in Mailchimp? Flag anything under 10.
The Autumn Sale links to 8 products, and 3 have stock problems. - Out of stock: Wool Throw, Grey, 214 clicks, keeps selling - Low: Linen Sheet Set, King, 6 left - Low: Ceramic Mug, Sage, 4 left, turns buyers away at zero - Not checked: 2 collection links Want the full variant table?
Shopify
Sample figures. Your results come from your own account.
mailchimp-get-campaign
mailchimp-get-campaign-click
shopify-get-product
shopify-get-product-variant

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

Shopify

Shopify
Run it on your own Shopify data.

Connect Shopify, pick your AI tool and paste the prompt.

Try PopdockAI free

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.

Prompt
**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.

Your AI tool

02

Read

It reads the campaign's product links and their clicks.

mailchimp-get-campaign
mailchimp-get-campaign-click

03

Check

It finds each product in Shopify and reads every variant's stock and policy.

shopify-get-product
shopify-get-product-variant

04

Report

You get variants marked out of stock, low or ok, with overselling notes.

Your AI tool

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.

get-data

mailchimp-get-campaign

Returns Mailchimp email campaigns with their status, audience, send date and headline results. Filter by status or send date to find drafts, scheduled sends or recent campaigns.
get-data

mailchimp-get-campaign-click

Returns click totals for each link in a Mailchimp campaign, so you can see which content drew attention.
get-data

shopify-get-product

Returns Shopify products. Filter by title, handle, product type, vendor, tags, product id and created date.
get-data

shopify-get-product-variant

Returns Shopify product variants with their SKU, barcode, price, inventory quantity and inventory policy. Filter by product, variant, SKU, barcode, title, price and inventory quantity.
Read only.Nothing in Shopify Changes

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.

How Popdock AI secures your data

The outcome

Stock problems caught before shoppers hit them

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

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.

Try PopdockAI Free
See Documentation