The Contribution Margin Formula — and How DTC Operators Should Actually Use It

Most contribution margin guides are written for finance students. This one is written for the Shopify operator who has a real store, a real ad spend line, and a real question: am I actually profitable on this product, and how do I know?

Contribution margin is the answer.

It’s the single metric that tells you, per product and per order, what’s left after the costs that move when you grow — product cost, shipping, payment fees, ad spend allocated to that order. Gross margin doesn’t include all of those. Net margin does, but only at the company level. Contribution margin sits in the middle: granular enough to be operational, complete enough to be honest.

This guide covers the formula, a worked DTC example, category benchmarks, and what to do when your contribution margin doesn’t match the target. If you want the 30-second answer, the formula is below. If you want the operator playbook, read on.

The contribution margin formula

For ecommerce, the practical formula is:

= Net Sales − Product Cost − Shipping Cost − Payment Fees − Fulfilment Cost − Allocated Ad Spend

You can apply this at three levels.

  • Per order: what is left over after the variable costs of fulfilling that single order.
  • Per SKU: the average per-unit contribution margin for a product, calculated across all orders of that SKU over a period (30 or 90 days is standard).
  • Blended: the total contribution margin across all orders in a period, useful for monthly P&L work.

Contribution margin percent is the same calculation expressed as a share of revenue:

Contribution Margin % = (Contribution Margin ÷ Revenue) × 100

So an order of €100 revenue with €35 of contribution margin is a 35% contribution margin order.

StoreHero Spend Advisor Dashboard showing Net Sales, MER, Spend & Contribution Profit
StoreHero Spend Advisor Dashboard showing Net Sales, MER, Spend & Contribution Profit

A worked DTC example

Imagine you sell a single skincare product on Shopify. The retail price is €60. A customer buys two of them in a single order, paying €120 before shipping, and you charge them €5 for shipping.


Here is the per-order math.

Line item Value ($) Notes
Revenue (product)
120.00
2 units × €60 retail
Shipping charged to customer
5.00
What they paid you

Total revenue

125.00

Product cost (COGS)
-28.00
€14 per unit × 2
Carrier shipping cost
-7.50
What you paid the carrier
Payment processing fee
-3.50
2.9% of total
Fulfilment cost
-4.00
3PL pick-and-pack per order
Allocated ad spend
-27.00
Meta + Google attributed to this order

Contribution margin

€55.00

Contribution Margin %

44.0%

55 ÷ 125

This is the order you want more of. A 44% contribution margin order means every €1 of revenue contributes €0.44 toward your fixed costs and profit.

Now imagine a different customer orders a single €60 unit and a €15 cleanser, with €5 shipping. Revenue is €80. The same allocated ad spend of €27 hits this order (because both customers came from the same Meta campaign with the same CAC). The math changes.

Line item Value ($)
Total revenue
80.00
Product cost
-16.50
Carrier shipping cost
-7.50
Payment processing fee
-2.30
Fulfilment cost
-4.00
Allocated ad spend
-27.00

Contribution margin

$22.70

Contribution margin %

28.4%

Same store. Same campaign. The first order is healthy. The second order is borderline, and you would not know that from looking at Shopify’s revenue report.

The point of the formula is to make that gap visible.

Book a StoreHero Demo

See how our AI Growth Coach can help grow your store, profitably.

Contribution margin vs gross margin vs net margin

Many ecommerce founders confuse contribution margin with gross margin. The two are not the same metric and they answer different questions.

Gross margin is revenue minus COGS only. It tells you the markup on the product itself, before any other variable costs.

Contribution margin is revenue minus all variable costs: product, shipping, fees, fulfilment, ad spend. It tells you the per-unit profitability after the costs that move when you grow.

Net margin is revenue minus all costs including fixed ones (rent, salaries, software, etc). It tells you the company-level profit.

Gross margin is too generous. It hides the costs that actually shape your unit economics. A brand can have 70% gross margin and 12% contribution margin because the freight, fulfilment, and paid acquisition costs eat the gap.

Net margin is too coarse. It only tells you the company-level outcome. You cannot use net margin to decide which SKUs to scale, which campaigns to pause, or whether to renegotiate with a supplier.

Contribution margin is the operating metric. It sits at the level where decisions get made.

CM1, CM2, CM3 explained

Some operators use a tiered version of contribution margin to separate the cost layers. There is no universal convention, but the common framing looks like this.

  • CM1: Revenue minus COGS. This is essentially gross margin. Useful for product-level pricing decisions.
  • CM2: CM1 minus shipping, payment fees, and fulfilment. This is contribution margin before paid acquisition. Useful for understanding the per-order unit economics of customers who arrived organically (email, SEO, returning customers, referrals).
  • CM3: CM2 minus allocated ad spend. This is the full contribution margin on a paid acquisition basis. Useful for understanding the true profitability of new customer acquisition.

If you scale paid ads, CM3 is the number you should be tracking weekly. CM1 and CM2 will both look healthy while CM3 quietly turns negative on the campaigns that are losing you money.

At StoreHero we default to CM3 in all reporting because that is the level that reflects what is actually happening in a paid-acquisition business.

StoreHero Finance Page
StoreHero Spend Advisor Dashboard showing Net Sales, MER, Spend & Contribution Profit

What good looks like: category benchmarks

The right contribution margin depends on your category. These are working benchmarks from the brands we see across StoreHero, which align broadly with what experienced DTC operators target.

Category Healthy CM3 range Notes
Food and beverage
20% to 40%
Low because of weight, perishability, and shipping cost
Beauty and supplements
60% to 80%
High because of strong markups and light shipping
Fashion and apparel
50% to 70%
Wider range because of returns and seasonal markdowns
Health and wellness
50% to 70%
Subscription brands often outperform one-off purchase brands here
Home and homewares
30% to 50%
Drag from bulky shipping and breakage rates
Consumer electronics
15% to 30%
Margin compressed by competitive pricing and accessory bundling
Pet
35% to 55%
Subscription dynamics help; food brands run lower

What to do when your contribution margin is wrong

The general rule: if you are scaling paid ads, target at least 35% contribution margin on CM3. Below 25% on CM3 and ad spend will tighten margins faster than revenue grows. Below 15% and you are likely buying customers at a loss without realising it.

  1. Repricing. A 5% to 10% retail price increase on hero SKUs is the fastest contribution margin lever. The reflexive answer is “we will lose volume.” The actual data, across hundreds of brands, is that demand elasticity for established DTC SKUs is lower than founders fear. Test on one product first if you are uncertain.
  2. Bundle math. Bundles raise AOV and amortise the fixed per-order costs (fulfilment, shipping, payment fees) across more units. A two-pack bundle on a €60 hero product, sold at €110, typically adds 6 to 10 percentage points to per-order contribution margin.
  3. Supplier renegotiation. Most brands renegotiate COGS too infrequently. If your annual volume on a SKU is rising, your supplier should reflect that in pricing. Six-month review cycles are reasonable.
  4. Shipping optimisation. Carrier mix, packaging dimensions, and zone skipping all compound. A brand shipping a 600g product in a 1.2kg-rated box is paying for air. An hour with a packaging consultant typically saves 10 to 20% on per-order carrier cost.
  5. Ad spend reallocation. Not all campaigns have the same contribution margin. Most brands have at least one campaign quietly losing money on a CM3 basis. The fix is usually to pause it rather than optimise it. See why ROAS misleads operators for the deeper version of this argument.
  6. Retention. Repeat purchases carry near-zero acquisition cost, which lifts CM3 dramatically. A brand that goes from 18% repeat rate to 28% typically sees 4 to 7 percentage points of blended contribution margin expansion in 6 to 9 months.

The order matters. Repricing and bundles are fast. Supplier renegotiation is medium-term. Retention is slow. Work the fast levers first.

How to track contribution margin in Shopify

Shopify’s native reports do not compute contribution margin. They show revenue, basic cost of goods if you populated it, and order counts. They do not allocate ad spend by order, do not include fulfilment cost from your 3PL, and do not net out payment fees. You have to do the work yourself or use a tool that does.

For brands under €1M GMV, a spreadsheet works. The structure is one row per order, with columns for the line items in the formula above. Pull Shopify orders monthly, join ad spend from Meta and Google by attributed sessions, layer in 3PL costs from your fulfilment partner’s report, and net out Stripe/Shopify Payments fees. It is tedious, but it scales until your order volume gets unwieldy.

Above €1M GMV the spreadsheet stops being viable. Order volume grows, ad spend gets multi-channel, and the time cost of maintaining the calculation outweighs the cost of a dedicated tool.

StoreHero is one of those tools. We pull your Shopify orders, your ad spend from Meta, Google, and TikTok, your product COGS, your fulfilment cost from your 3PL, and your payment processor fees into one model that computes CM1, CM2, and CM3 automatically per order and per SKU. Start Your Free 7 Day Trial on the Shopify App StoreIf you want to compute it before deciding on a tool, we also have a free contribution margin calculator that handles the per-order math.

Two common mistakes

Mistake 1: Not allocating ad spend. The most common error in operator-built spreadsheets is computing CM2 and calling it contribution margin. CM2 is honest about per-order economics but does not reflect the cost of acquiring the customer. If you scale paid ads and report CM2 as your contribution margin, you will scale unprofitable campaigns without realising it. Always include CM3.

Mistake 2: Using last-click attribution for ad spend allocation. Most analytics tools (Triple Whale, Polar, Northbeam) report attribution differently than Meta and Google do. If you allocate ad spend by Meta’s reported attribution, you will systematically over-credit Meta and under-credit organic, email, and SEO. Use blended attribution or a consistent third-party model.

What to read next

If you want to act on contribution margin: try the calculator on a recent order.

If you want the longer playbook on improving margins: read The Brand Founder’s Guide to Improving Margins.

If you want to understand why most analytics tools mislead operators on this: read ROAS vs Profitability and MER vs ROAS.

If you want to see how an AI agent can compute contribution margin per SKU on demand: explore our Claude MCP for Ecommerce.

How to track contribution margin in Shopify

Shopify’s native reports do not compute contribution margin. They show revenue, basic cost of goods if you populated it, and order counts. They do not allocate ad spend by order, do not include fulfilment cost from your 3PL, and do not net out payment fees. You have to do the work yourself or use a tool that does.

For brands under €1M GMV, a spreadsheet works. The structure is one row per order, with columns for the line items in the formula above. Pull Shopify orders monthly, join ad spend from Meta and Google by attributed sessions, layer in 3PL costs from your fulfilment partner’s report, and net out Stripe/Shopify Payments fees. It is tedious, but it scales until your order volume gets unwieldy.

Above €1M GMV the spreadsheet stops being viable. Order volume grows, ad spend gets multi-channel, and the time cost of maintaining the calculation outweighs the cost of a dedicated tool.

What is the contribution margin formula?

 

Contribution margin equals revenue minus product cost, shipping, payment fees, fulfilment cost, and allocated ad spend. The result is what is left to cover fixed costs and profit. 

How do you calculate contribution margin for an ecommerce store?

For each order, subtract from revenue: product COGS, shipping cost, payment processing fees, fulfilment cost, and the ad spend attributed to that order. The remainder is the order’s contribution margin. For per-SKU contribution margin, do the same calculation aggregated by SKU over a period.

What is a good contribution margin for a Shopify store?

It depends on category. Food and beverage runs 20% to 40%. Beauty and supplements runs 60% to 80%. Fashion and apparel runs 50% to 70%. If you are scaling paid ads, target at least 35% contribution margin on CM3 (after allocated ad spend) to scale profitably.

What is the difference between contribution margin and gross margin?

Gross margin is revenue minus product costs or in some cases minues all variable costs (COGS). Contribution margin is always revenue minus all variable but also deducts ad spend. Gross margin tells you the markup on the product itself. Contribution margin tells you what each sale is worth after the costs that move with volume.

How is CM1, CM2, CM3 calculated?

CM1 equals revenue minus COGS, similar to gross margin. CM2 equals CM1 minus shipping, payment fees, and fulfilment. CM3 equals CM2 minus allocated ad spend. Different operators use different definitions. At StoreHero we default to CM3 because that is the level that reflects true unit economics in a paid-acquisition business.

How do I track contribution margin in Shopify?

Shopify’s native reports do not compute contribution margin. They only show revenue and basic cost data. To track it, combine Shopify orders with ad spend (Meta, Google, TikTok), fulfilment cost, payment fees, and your product COGS. Tools like StoreHero compute this automatically. A spreadsheet works for stores under €250K GMV.

Why don’t many agencies track contribution margin?

The best ones all do.

It requires access to full financial data (COGS, shipping, fees, marketing costs). Many agencies prefer surface-level metrics like ROAS, which are easier to report but less accurate. 

The best agencies want to be held account to financial metrics aswell as marketing metrics. 

What is the formula for contribution margin percent?

Contribution margin % equals (contribution margin ÷ revenue) × 100. An order with €100 revenue and €35 contribution margin is a 35% contribution margin order.

What is the difference between CM2 and CM3?

CM2 excludes allocated ad spend. CM3 includes it. CM2 tells you the per-order economics of customers who arrived for free (email, organic, returning). CM3 tells you the per-order economics on a paid acquisition basis. If you scale paid ads, CM3 is the operating metric.

What contribution margin do I need to scale paid ads profitably?

A working rule: target at least 35% contribution margin on CM3 to have headroom to scale paid acquisition. Below 25% on CM3 you will see margins compress faster than revenue grows. Below 15% you are likely buying customers at a loss.

Why is my contribution margin lower than my gross margin?

Because contribution margin includes shipping, payment fees, fulfilment, and ad spend, while gross margin only nets out product cost. A brand with 65% gross margin can easily have 25% contribution margin once those additional variable costs are factored in. The gap is normal. The question is whether your contribution margin meets your category benchmark and your goals.

Book a StoreHero Demo

See how our AI Growth Coach can help grow your store, profitably.

One Response