Shopify Product Variant Margin Analysis With AI | Tugger
All blogs
Shopify AI MCP Claude

One Prompt to See Which Shopify Product Variants Are Dragging Down Your Margins

Product-level reports hide which sizes and colours return too often or barely sell; this prompt shows variant-level margin in three tables.

4 min read

Most ecommerce businesses track performance at the product level. They know a particular hoodie is the best seller, or a specific skincare kit drives the highest revenue. What they miss is what is happening at the variant level: which sizes, colours or configurations are profitable, and which are quietly eroding margin through high return rates, slow stock turns or pricing that never got updated. This guide shows how to see it in one prompt using Tugger, which syncs your Shopify store into a data warehouse that Claude, ChatGPT and Gemini can query directly.

Shopify has the data. ShopifyProductVariants records pricing for each variant, ShopifyOrderLineItems ties every purchase back to a specific variant, and ShopifyRefunds shows what came back. Shopify's built-in analytics do not join them in a way that surfaces variant-level profitability in a single view.

The problem with product-level reporting

Imagine you sell a workwear jacket in five sizes and three colours. At the product level, the jacket looks healthy: good volume, reasonable return rate, solid average order value.

At the variant level, the picture may be quite different. The XL in black might have a 14% return rate driven by fit. The S in navy might be sitting unsold for 90 days. The M in khaki might be your highest-margin combination because it is priced the same as the others and has half the returns. None of this shows up in a product-level report, and you cannot act on it until you can see it.

How the prompt reaches your Shopify data

Tugger syncs your Shopify store into a managed data warehouse on a schedule, and its built-in MCP server lets Claude, ChatGPT and Gemini query that warehouse directly. If MCP is new to you, our MCP server guide covers it. The connection is read-only: the AI queries the warehouse, never your Shopify admin. Setup is in how to connect Shopify to Claude.

The prompt

Copy this into Claude, ChatGPT or Gemini once your Shopify store is connected to Tugger.

Role: You are an ecommerce merchandising analyst.

Context: Use the ShopifyProductVariants, ShopifyOrderLineItems, ShopifyRefunds, ShopifyProducts and ShopifyOrders data provided via Tugger MCP. Exclude cancelled and test orders.

Task: Analyse order and refund data from the last 90 days at the product variant level. For each variant with at least 10 orders in the period, calculate total units sold, total gross revenue (quantity multiplied by price at time of order), total units refunded, refund rate (refunded units divided by units sold) and net revenue after refunds. Then identify variants with a refund rate above 8%, variants with net revenue in the bottom 20% of all variants analysed, and variants where total units sold in the period is fewer than 3.

Output: Three sections. Section 1, High refund rate variants: a table with Variant Title, Product Name, Units Sold, Refund Rate and Net Revenue. Section 2, Low net revenue variants: the same columns. Section 3, Near-dead variants: a table with Variant Title, Product Name, Units Sold in Period, and a note if the variant is still priced and active.

What to expect

The first section usually surfaces one or two variants that the team had a vague sense were a problem but could not prove. A 12% refund rate on a specific size in black is a different conversation from "customers seem to have trouble with the fit".

The second section often highlights variants carried at the same marketing and stock cost as the high performers while generating a fraction of the return. These are candidates for a price change, a bundle, or discontinuation.

The third section is frequently the most surprising. Stores often find variants that are still live, still priced, still consuming fulfilment overhead, and have sold a handful of units in three months. These are decisions that should have been made long ago, but the data was never in a convenient form.

When the first answer is not enough

A high refund rate matters more if it is getting worse. Ask this as a follow-up in the same conversation.

Role: You are an ecommerce merchandising analyst.

Context: Continue with the Shopify data already loaded via Tugger MCP.

Task: For the high refund rate variants identified in the previous output, check whether the refund rate has increased, stayed flat or decreased over the last three 30-day periods (0 to 30 days ago, 31 to 60 days ago, 61 to 90 days ago).

Output: A table per variant showing the refund rate for each 30-day period and a trend direction (Improving, Stable or Worsening).

A variant with a high refund rate that is improving might just need better sizing guidance on the product page. One that is worsening month on month is a stronger case for discontinuation. To see whether discounting is part of the picture, run the discount code review next; the two together usually explain most of a store's margin leak.

Adjusting the thresholds

The prompt uses 10 orders as the minimum for inclusion. With a large catalogue of low-volume variants, lower it to 5. To focus only on high-volume lines, raise it to 25. The 8% refund threshold suits apparel; for consumables or hard goods, 3% to 4% is the more useful line.

Related guides

Get started

Connect your Shopify store to Tugger, open Claude, ChatGPT or Gemini and run the prompt against your own catalogue. Tugger is UK-based, ISO 27001:2022 certified and connects 70+ systems including Xero, HubSpot, Simpro and Harvest, with no code, no faff. Try Tugger free for 10 days or book a demo.

Read next

More Reasons to Choose Tugger®

Don't just take our word for it.

Working with the AI agent through Tugger, blending Simpro, Xero and my other systems together, I came up with a really detailed, factual investigation.
Jeff Smith
Partner & Director of Digital Disruption · Envirotech Group
Batch invoicing and reporting used to eat hours of admin time each week, chasing details back and forth between Simpro and our spreadsheets. Now it runs on its own, and because Tugger guides the AI to the right figures, I can trust what comes out.
Beau Berg
Operations Manager · Australian Airport Services
One of our customers wants a monthly evaluation pack built from thousands of Simpro jobs. It used to take a full day. Now our data reaches Claude through Tugger and the pack comes back in ten minutes, exactly how they want it.
John Trickett
Head of Digital & Technology · Severnside Security Limited
It’s helped me keep my finger on the pulse of each department without having to be down in the trenches to get that pulse.
Matthew Skoglund
General Manager · West Crane Services