MerchantFlowMerchantFlow Docs
Dashboard

Discount Codes - Per-Code Margin and Profitability Analysis

Track every Shopify and WooCommerce discount code by uses, gross revenue, discount cost, COGS, ad spend, gross profit, and margin in MerchantFlow.

Discount Codes

The Discount Codes page in MerchantFlow shows every code your customers redeemed during the selected period, ranked by gross profit by default. For each code you can see uses, gross revenue, the cost of the discount itself, allocated COGS and ad spend, and the resulting gross profit and margin percentage. The page is titled Discount code margin.

What Does This Page Show?

Each row is one redeemable code (typed at checkout or applied automatically). MerchantFlow aggregates every order that used the code in the timeframe and computes:

  • Uses - number of orders that applied the code
  • Gross revenue - the order subtotal, which in MerchantFlow is already net of the discount
  • Discount - the dollar value given back through the code
  • COGS - cost of goods for items in those orders
  • Ad spend - proportional share of ad spend attributed to those orders
  • Gross profit - gross revenue minus COGS minus ad spend
  • Margin % - gross profit divided by gross revenue, colour-coded by health
Gross profit = Gross revenue - COGS - Ad spend
Margin %     = Gross profit / Gross revenue x 100

The discount is not subtracted again. Because order subtotals in MerchantFlow are already post-discount, the Discount column is reported alongside the profit figure as context, not deducted from it. Subtracting it yourself would double-count the promotion.

Only orders with a payment status of paid, completed, or processing are counted, and cancelled orders are excluded. Refunded and partially refunded orders do not appear on this page.

How to Access Discount Codes

Navigate to Marketing > Discount Codes (/dashboard/discount-codes). The page is available on every plan and needs no feature flag.

The page respects the global timeframe selector, so the discount data always matches the timeframe shown in the rest of the dashboard.

Headline KPIs

Four KPI tiles summarise discount activity in the selected timeframe:

  • Codes used - unique codes redeemed in this period
  • Redemptions - orders that used at least one code
  • Discount cost - total discount amount given back to customers
  • Avg margin - weighted by revenue across all codes, not a plain average of the per-code percentages. Colour-coded:
    • Green: 15% or higher
    • Amber: 0% to 15%
    • Rose: below 0% (loss-making overall)

Because Avg margin is revenue-weighted, one high-volume code moves it far more than a rarely used one.

Sorting and Pagination

The table has eight columns - Code, Uses, Gross revenue, Discount, COGS, Ad spend, Gross profit, and Margin % - and every one of them is sortable. Click a column header to toggle ascending or descending. The default sort is gross profit, descending, so the most profitable codes appear first.

The table paginates at 25 rows. Use the Previous and Next controls at the bottom to walk through more codes.

There is no CSV export on this page.

How Codes Share the Margin

When an order uses more than one code, its revenue, COGS, and ad spend are split between the codes in proportion to how much each one discounted the order. Single-code orders are credited in full. The page carries an on-page note explaining this.

Ad spend itself is never reported per code by ad platforms. MerchantFlow allocates ad spend to orders, then aggregates it up to each code using the same proportional split.

Reading the Margin Column

The margin column uses the same colour scheme as elsewhere in MerchantFlow:

  • Emerald - 30% or higher
  • Green - 20% to 30%
  • Amber - 10% to 20%
  • Rose - below 10%, including any negative margin

A code in the rose band means every redemption is destroying margin once COGS, ad spend, and the discount itself are subtracted. Use this to identify codes to retire or restrict.

When the Page Is Empty

If no orders in the timeframe used any discount code, the page shows an empty state reading "No discount codes used yet". This usually means either you did not run discounts in this period, or the orders that used codes have not yet synced from Shopify or WooCommerce. Check Sync Status to confirm.

Historical discounts from before MerchantFlow started tracking them need a one-off backfill - contact [email protected] if past promos are missing.

Frequently Asked Questions

Do you track auto-applied discounts (price rules without codes)?

Yes, and usually per rule. A Shopify automatic discount is recorded under its own title, so each rule gets its own row alongside the codes typed at checkout. Manual and script discounts work the same way, falling back to MANUAL and SCRIPT when they carry no title.

A row labelled AUTOMATIC is the catch-all for a discounted order MerchantFlow could not attribute to any specific rule -- a Shopify order with a discount amount but no discount application (legacy orders, some shipping discounts), or a WooCommerce order whose discount_total is set with no coupon lines, which is what auto-discount plugins produce.

How is the discount cost computed?

It is the discount amount recorded on the order for that code. Where an order carries several codes, each code is credited with its own share. Note again that this amount is not deducted from the Gross profit column, because the gross revenue figure is already post-discount.

Why does ad spend appear non-zero on a discount code's row?

Ad spend is allocated to orders, not to discount codes. If an order that ultimately used a code was driven by a click from a paid campaign, the allocated ad spend on that order flows into the discount code row by aggregation. This is a faithful per-code profitability view, not a per-code paid-spend view.

Can I see a single code's order list?

No. There is no drill-down from a code to its orders, and the Orders page has no discount-code filter -- its search box matches order number, platform order id, and customer name or email only. An individual order's detail page shows the Discount amount it received, but not which code produced it.

How does this differ from the Discount Impact tool?

The Discount Impact tool is a forecasting calculator for a hypothetical discount. The Discount Codes page is a historical view of codes you actually ran.


Last updated: August 29, 2026

Last updated on

On this page