Contribution margin is what a sale contributes to the business after you subtract every cost that only exists because that sale happened. For an online store that means the product itself, shipping it, the payment processor's cut, picking and packing and, at the last step, the advertising that brought the order. What remains has to cover fixed costs such as salaries, software and rent; anything left after that is operating profit. Gross margin stops after product cost, which is why it can look excellent for a store that is actually losing money.
The formula, in three layers
Net revenue = gross sales − discounts − refunds (excluding VAT / sales tax) CM1 (gross profit) = net revenue − COGS CM2 (contribution before ads) = CM1 − shipping − payment fees − pick & pack − packaging CM3 (contribution after ads) = CM2 − ad spend Operating profit = CM3 − fixed costs
The names CM1, CM2 and CM3 are a common convention, not an accounting standard, and some teams draw the lines slightly differently, for example putting returns handling into CM2 or agency fees into CM3. What matters is being consistent: a cost belongs in contribution if it scales with orders, and in fixed costs if it stays roughly the same whether you ship 500 or 1,500 orders.
A full monthly P&L, line by line
Here is a hypothetical store for one month. It sells physical products, ships from its own small warehouse and runs paid social ads. It shipped 1,100 orders that were not refunded. All figures exclude VAT.
| Line | Amount | % of net revenue |
|---|---|---|
| Gross sales | 100,000 | |
| − Discounts | 5,000 | |
| − Refunds | 7,000 | |
| = Net revenue | 88,000 | 100.0% |
| − COGS (landed cost of units kept) | 30,800 | 35.0% |
| = CM1 / gross profit | 57,200 | 65.0% |
| − Shipping to customers | 7,920 | 9.0% |
| − Payment fees | 2,640 | 3.0% |
| − Pick & pack | 3,520 | 4.0% |
| − Packaging | 880 | 1.0% |
| = CM2 / contribution before ads | 42,240 | 48.0% |
| − Ad spend | 22,000 | 25.0% |
| = CM3 / contribution after ads | 20,240 | 23.0% |
| − Fixed costs (team, software, rent) | 16,000 | 18.2% |
| = Operating profit | 4,240 | 4.8% |
Check the arithmetic, because a P&L that does not add up teaches nothing:
Net revenue = 100,000 − 5,000 − 7,000 = 88,000 CM1 = 88,000 − 30,800 = 57,200 (57,200 / 88,000 = 65.0%) Variable fulfilment = 7,920 + 2,640 + 3,520 + 880 = 14,960 CM2 = 57,200 − 14,960 = 42,240 (42,240 / 88,000 = 48.0%) CM3 = 42,240 − 22,000 = 20,240 (20,240 / 88,000 = 23.0%) Operating profit = 20,240 − 16,000 = 4,240 (4,240 / 88,000 = 4.8%)
What each subtotal tells you
- CM1 at 65% says pricing against product cost is healthy. Many owners stop here and conclude the business is very profitable.
- CM2 at 48% is the real economics of an order before marketing: 17 points of margin went to logistics and fees. This is the number that defines how much you can pay for a customer.
- CM3 at 23% shows how much of each unit of revenue is left after buying the traffic. If this goes negative, every order makes the hole deeper.
- Operating profit at 4.8% is what the month actually earned. With fixed costs at 18.2% of revenue, the store needs CM3 to stay above that just to break even.
The same P&L per order
Dividing by the 1,100 orders turns the P&L into unit economics, which is how you make ad decisions.
Average net order value = 88,000 / 1,100 = 80.00 CM2 per order = 42,240 / 1,100 = 38.40 Ad spend per order (blended CPA) = 22,000 / 1,100 = 20.00 CM3 per order = 38.40 − 20.00 = 18.40 (check: 20,240 / 1,100 = 18.40)
Break-even ROAS and maximum CPA
CM2 is the ceiling on what you can spend to win an order without losing money on it. From it come two numbers every store running ads should know.
Break-even ROAS = 1 / CM2% = 1 / 0.48 = 2.08 Maximum CPA per order = CM2 per order = 38.40
At a ROAS of exactly 2.08 measured on net revenue, or a CPA of 38.40, each order covers its own costs and contributes nothing to fixed costs. The current blended CPA of 20.00 leaves 18.40 per order. Note that these are first-order figures; if customers reliably buy again, you may decide to accept a higher CPA, but that is a deliberate bet on lifetime value, not something to discover by accident.
How many orders cover fixed costs
Orders to break even = fixed costs / CM3 per order = 16,000 / 18.40 = 869.6, so 870 orders
At current costs and CPA, the first 870 orders of the month pay for the team, software and rent. Only the orders after that produce profit: 230 orders × 18.40 = 4,232, which matches the 4,240 operating profit apart from the rounding in 869.6.
Contribution margin by product
Store-wide CM hides big differences between products. Shipping and handling are often similar per order regardless of price, so they hit cheap products much harder. Compare two hypothetical products, each sold alone in an order:
| Per order | Product A | Product B |
|---|---|---|
| Net price | 50.00 | 30.00 |
| COGS | 15.00 | 8.00 |
| Gross margin (CM1 %) | 70.0% | 73.3% |
| Shipping | 6.00 | 6.00 |
| Payment fees (3%) | 1.50 | 0.90 |
| Pick & pack | 3.00 | 3.00 |
| CM2 | 24.50 | 12.10 |
| CM2 % | 49.0% | 40.3% |
| Break-even ROAS | 2.04 | 2.48 |
A: 50.00 − 15.00 − 6.00 − 1.50 − 3.00 = 24.50; 24.50 / 50 = 49.0%; 1 / 0.49 = 2.04 B: 30.00 − 8.00 − 6.00 − 0.90 − 3.00 = 12.10; 12.10 / 30 = 40.3%; 1 / 0.403 = 2.48
Product B looks better on gross margin, 73.3% against 70%, but it leaves half as much money per order and needs a higher ROAS to break even. If you allocate ad budget by gross margin, you push the wrong product. Bundles and free-shipping thresholds exist largely to fix this: spreading the fixed per-order costs over a bigger basket raises CM2 percentage.
Levers that move contribution margin
- Price: a small price rise flows almost entirely into CM2, because COGS and shipping do not change with it.
- Average order value: bundles and thresholds spread shipping and handling across more revenue.
- Shipping rates: renegotiating or changing carrier zones changes every single order. In the example, 1 less per order is 1,100 a month.
- Discount depth: a 10% code on an 80 order removes 8 of revenue but none of the cost, so it comes straight out of CM2.
- Refund rate: each refunded order can carry lost shipping, fees and sometimes unsellable stock.
- Product mix: moving ad spend towards high-CM2 products raises CM3 without touching the total budget.
Mistakes that distort contribution margin
- Calculating with prices including VAT, which inflates revenue without adding margin.
- Using supplier price instead of landed cost (freight, duties, inbound handling) as COGS.
- Putting shipping or payment fees in overheads, so they disappear from per-order economics.
- Taking an average margin across countries or products and applying it everywhere.
- Mixing periods: refunds processed this month for orders sold last month.
The hard part is not the formula; it is having every variable cost per order in one place and up to date. ProfitFly calculates this from your Shopify orders, product costs and ad spend, so CM before and after ads is visible per day, product and country rather than once a month in a spreadsheet.
Frequently asked questions
What is the difference between gross margin and contribution margin?
Gross margin only subtracts the cost of the product. Contribution margin also subtracts every other cost that grows with each order, such as shipping, payment fees, fulfilment and, in CM3, advertising.
Should ad spend be included in contribution margin?
Both versions are useful. CM2 excludes ads and tells you how much you can afford to pay for an order; CM3 includes ads and tells you what is left for fixed costs and profit.
Is contribution margin the same as net profit?
No. Net or operating profit also subtracts fixed costs such as salaries, software and rent. Contribution margin is what is available to pay those costs.
What is a good contribution margin for ecommerce?
It depends on category, price point and fixed costs, so there is no single target. The useful test is whether CM3 covers your fixed costs with room to spare at the order volume you expect.