AgentSales & profitability

Discount code analysis

Find the discount codes quietly eating margin — and the ones bringing genuine incremental profit. Plus what to do with each.

Works with
ClaudeChatGPTAny MCP-compatible AI tool
Requires
StoreHero MCPShopify
Get the prompt
Example chat in Claude. You ask: "Run the Discount code analysis agent for month to date". Claude reads your StoreHero data and answers: Contribution margin is up 8% on last year, month to date. Week 3 dipped when discounting rose. It adds an interactive example chart, Weekly contribution margin vs last year, with example data you can switch below.
Weekly contribution margin vs last yearExample

Example, Contribution margin: $83.5k month to date, +8% vs last year

  • W1: $18.2k (last year $16.9k)
  • W2: $21.4k (last year $19.0k)
  • W3: $19.8k (last year $20.5k)
  • W4: $24.1k (last year $21.2k)

Dashed line: last year

Week 1: $18.2k vs $16.9k last year.

The prompt

How to run it

Paste it into a new chat in Claude or ChatGPT and you get the answer straight away.

Use the StoreHero MCP to do the following analysis. Always anchor the answer in real StoreHero data, not platform-reported metrics.

Give me a discount code analysis for month-to-date vs the same period last year. Pull orders grouped by discount code from the StoreHero connector. For each code, show: orders attributed, revenue, discount % vs full price, AOV with code vs store average, gross profit per order with code vs store average, and contribution margin per order.

Identify codes that are statistically significant — minimum 30 orders or 1% of total order volume — to filter out noise. Then flag codes where the gross profit per order is meaningfully below the store-wide average — these are eating margin, and the customer would likely have purchased without the code (or at a higher AOV).

Apply a traffic-light system: (1) green — code is bringing profitable incremental customers, keep running, (2) amber — worth reviewing, may be cannibalising full-price purchases, (3) red — critical issue, code is dragging contribution margin meaningfully below store average.

For each red and amber code, suggest a concrete action — sunset the code, raise the minimum order threshold, switch from % off to free-product gift, restrict to new customers only, or end-date it.

At the bottom of your answer, render an inline visual summary: an interactive bar chart of orders grouped by discount code with gross-profit-per-order overlay and traffic-light status colour-coding. Add a KPI card for total margin lost to discounting vs LY. Place text commentary alongside the visuals. Use the Spend Advisor tool to suggest what to explore next.

Get the full prompt

Enter your email to see every prompt in full and copy it in one click. It unlocks the whole library.

See our privacy policy.

How to use a skill

New to skills? It takes three steps and a few minutes: connect StoreHero once, copy a skill into Claude or ChatGPT, and ask.

  1. Connect StoreHero to Claude or ChatGPTAdd the StoreHero MCP connector once. It works with Claude, ChatGPT and any other tool that supports MCP. Setup guide
  2. Pick a prompt and copy it into ClaudeOpen one, press Copy prompt (or download the file) and paste it into a new chat.
  3. AskIt pulls your live StoreHero data and gives you the analysis in minutes. Ask follow-up questions in the same chat.

Run every prompt on your own numbers.

Connect your store to StoreHero and the whole library works on your live profit data.