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.
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 - sum of order revenue before the discount was deducted
- Discount cost - dollar value of the discount itself (the difference between pre-discount and post-discount line totals)
- Total COGS - cost of goods for items in those orders
- Ad spend allocated - proportional share of ad spend attributed to those orders
- Gross profit - revenue minus discount cost minus COGS minus allocated ad spend
- Margin % - gross profit divided by gross revenue, colour-coded by health
How to Access Discount Codes
Navigate to Marketing > Discount Codes from the main navigation.
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:
- Total Codes - distinct codes redeemed at least once
- Total Uses - number of orders that used any code
- Discount Cost - total dollars given away through discounts
- Average Margin - mean margin percentage across all redeemed codes, colour-coded:
- Green: 15% or higher
- Amber: 0% to 15%
- Rose: below 0% (loss-making average)
Sorting and Pagination
Every column in the table 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.
How Ad Spend Is Allocated
Ad spend is not known per code by ad platforms. MerchantFlow allocates ad spend to orders using the same attribution model that powers the rest of the dashboard, then aggregates per code. The on-page allocation note explains this so the discount cost and the allocated ad spend are never confused.
Reading the Margin Column
The margin column uses the same colour scheme as elsewhere in MerchantFlow:
- Emerald - healthy margin
- Slate - thin but positive
- Amber - low single digits
- Rose - negative margin (the code is losing money)
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 with a ticket icon. This usually means either you do 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.
Frequently Asked Questions
Do you track auto-applied discounts (price rules without codes)?
This page tracks codes that were applied at checkout (either typed by the customer or auto-applied through a code rule). Site-wide automatic discounts that do not carry a code are not currently broken out per-rule on this page; they still reduce revenue in your P&L.
How is the discount cost computed?
The discount cost is the difference between the pre-discount and post-discount line totals on the order. Shipping discounts and tax adjustments are not included in the discount cost number.
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?
Not directly from this page. To inspect the orders that used a specific code, go to Orders and filter by the discount code value.
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.
Related Guides
- Unit Economics - true CAC, LTGP, and break-even ROAS
- Attribution - how orders are assigned to channels
- Orders - per-order profitability with margin and ROAS
- COGS Management - ensure cost data is complete before reading margins
- Ads and Channels - paid media performance
Last updated: May 23, 2026
Marketing Attribution System
Track which channels and campaigns drive revenue. Set up attribution rules for UTM, order tags, and product-based matching in MerchantFlow.
Merchant Center Diagnostics & Feed Health
Monitor Google Merchant Center product approvals, fix disapprovals, and improve feed quality scores in MerchantFlow. Step-by-step issue resolution.