How to use COGS Allocation

Metricuno
May 20, 2026
7 min read
How to use COGS Allocation — How to allocate COGS to orders and campaigns on Shopify — landed unit cost, freight-in, blended margins, and the SKU-mix trap that breaks ROAS math.
Quick answer

A practical guide to assigning cost of goods sold to orders and campaigns so your contribution margin and ROAS reflect reality — landed unit cost, freight-in, blended SKU margins, and the SKU-mix problem when one creative scales a low-margin hero product.

Definition
Profitability

COGS Allocation

Assigning landed product cost to each order and campaign so contribution margin and ROAS reflect real unit economics, not list prices.

COGS allocation is the method you use to attribute cost of goods sold to individual orders, SKUs, and marketing campaigns. Done well, it converts revenue into contribution margin and turns ROAS into a number you can actually bank.

For a Shopify or WooCommerce store, allocation means three things in sequence: building a landed unit cost per SKU (factory cost plus freight-in, duty, and inbound handling), pushing that cost into your order data so every line item carries it, and then rolling those costs up by campaign or creative so ad spend gets matched against real margin — not gross revenue.

Also known as
product cost allocation
landed cost attribution
unit-level COGS

Most stores under €15M run ROAS off gross revenue and discover, usually in Q4, that their best-scaling creative is selling a 22% margin hero SKU while the dashboard shows a healthy 3.2x. The campaign is unprofitable. COGS allocation is what closes that gap.

It also sits one step upstream of contribution margin per order — you cannot compute the latter honestly without first deciding what counts as product cost and how it gets attached to each line item. Get the allocation right and everything downstream (channel P&L, creative ROI, discount tolerance) snaps into place.

What actually belongs in landed unit cost

Landed unit cost is the all-in cost to get one sellable unit onto your shelf — physical or virtual. The factory invoice is the floor, not the ceiling. Stop there and your margins look 8-15 points better than they are.

The components that belong inside landed cost: ex-works factory price, freight-in (sea, air, or trucking), import duty and tariffs, customs brokerage, inbound handling at your 3PL, and any per-unit QC or rework. For a beauty SKU shipped from Korea to a Rotterdam warehouse, freight-in and duty can add 18-30% on top of the factory price.

What does NOT belong: outbound shipping to the customer, pick-and-pack fees, payment processing, returns processing, and discounts. Those are real costs, but they're variable order costs — they live in contribution margin, one layer down, not in unit COGS. Mixing them in makes per-SKU comparisons meaningless.

The freight-in trap

Freight-in is lumpy — you pay for a container, not a unit. Allocate it by landed weight or cubic volume per SKU, not by unit count. A container of 5,000 candles and 5,000 lipsticks does not split freight 50/50; the candles take 80%+ of the volume. Splitting evenly under-costs your heavy SKUs and silently inflates their apparent margin.

The SKU-mix problem when scaling paid

Here is where blended margins quietly kill performance reporting. Suppose your store sells across three product tiers with margins of 62%, 48%, and 28% landed. Your overall blended margin is 46%. Your ROAS target is built on that 46%.

Then one creative starts winning on Meta — and it features the 28% margin hero SKU. Spend scales from €8k to €40k. ROAS holds at 3.0x. But the SKU mix in those orders has shifted hard toward the low-margin product, and the real contribution margin on that incremental €32k of spend is roughly half what your model assumed.

Chart

Blended margin vs. campaign-level margin as a hero SKU scales

0%10%20%30%40%50%816243240Contribution margin (%)Monthly ad spend (€k)

Store-wide blended margin

Campaign-level margin (hero SKU)

The fix is to allocate COGS at the line-item level and roll up margin per campaign, not per store. You'll see the wedge open up in real time and can either rebalance creative toward higher-margin SKUs or accept the lower ROAS target on hero-product campaigns. Either way, you're making the decision with eyes open.

Allocation methods, ranked by honesty

Not every store needs SKU-level landed cost from day one. The right method depends on catalog complexity, how lumpy your freight is, and how much your margin varies across the range. The table below is the rough ladder most stores climb as they mature.

If your top 20 SKUs drive 80% of revenue and their margins are within 5 points of each other, a single blended rate works fine. The moment you have a hero SKU with materially lower margin — or you start scaling spend past €20k/month — you need per-SKU allocation.

Benchmark

COGS allocation methods by store maturity

MethodWhen to useMargin error vs. realitySetup effort
Flat blended % of revenueSingle-product or near-uniform margins±5-12 points1 hour
Blended landed marginNarrow catalog, similar SKU economics±3-7 pointsHalf day
Per-SKU factory cost onlyMulti-SKU catalog, low import duty±2-5 points1-2 days
Per-SKU landed cost (freight + duty allocated by volume)Mid-size catalogs, mixed margins, ad spend >€20k/mo±1-2 points1-2 weeks
Per-SKU landed + per-order variable costsReporting contribution margin per order honestly<1 point2-4 weeks

The jump from blended to per-SKU landed is where most stores find their biggest reporting correction — typically 4-8 margin points, almost always in the unflattering direction. Plan for that emotionally before you run the numbers.

Operationalising COGS allocation on Shopify

Shopify stores the per-variant cost in the `cost` field on the inventory item, but it's a single number with no history. That means three operational habits matter: keep the cost field accurate per landing (not per quarter), version your landed cost calculation in a spreadsheet so you can explain margin shifts, and snapshot cost into the order line item at purchase time so old orders don't silently re-cost when you update inventory.

For freight-in and duty allocation, the cleanest pattern is a per-shipment landing file: total landed cost ÷ allocated unit count, by SKU, weighted by cubic volume. Recalculate on each inbound container and refresh the Shopify cost field. Skip this and your gross margin reports drift 2-3 points per quarter.

From allocation to contribution margin

Landed unit cost is the foundation, but it's not the finish line. To get to contribution margin per order, layer on the variable per-order costs — outbound shipping, pick-and-pack, payment fees, expected returns, and discount used. COGS allocation answers 'what did this unit cost me?' Contribution margin answers 'what did this order earn me after everything that varied with the sale?'

Frequently asked

Frequently asked questions

Bundles need component-level allocation: sum the landed cost of each SKU in the bundle and assign it to the bundle's order line. Most stores use a bundling app (or a custom liquid template) that explodes the bundle into component SKUs at order time so reporting stays accurate. Don't set a flat bundle cost — you'll lose the per-SKU signal.

Freight-in belongs in COGS — it's a cost of acquiring sellable inventory, so it lands in landed unit cost. Outbound freight to the customer is different: that's a variable order cost and sits in contribution margin per order, not in COGS.

On every inbound shipment for active SKUs, and at minimum quarterly for slow movers. Factory prices, freight rates, and duty rates all move — a cost field that hasn't been touched in six months is almost certainly wrong by 5%+ either way.

COGS allocation gives you the product cost embedded in an order — the landed unit cost of everything sold. Contribution margin per order takes that and subtracts all other variable costs (shipping, processing, returns, discounts). Allocation is the input; contribution margin is the output.

Roll up line-item landed cost by attributed order, then group by campaign. The output is campaign-level contribution before ad spend, which you compare to spend to get a true margin-aware ROAS. Most analytics tools that pull Shopify order data plus ad platform attribution can do this — Metricuno handles it natively against historical GA4.

Returns affect contribution margin, not landed unit cost itself. The landed cost of a returned unit doesn't change — but you lose the revenue and incur reverse logistics and restocking costs. Model an expected return rate per SKU into contribution margin downstream rather than inflating COGS.

Allocate by cubic volume (CBM) per SKU, not by unit count or invoice value. A container is priced on space, so heavy or bulky SKUs should absorb more freight per unit. Pull the CBM from your packing list, multiply by units shipped, and divide each SKU's share into total landed freight.

No — discounts don't change what the unit cost you. They change the revenue side. Keep COGS allocation clean at landed cost, and let discounts hit revenue and contribution margin. Mixing discount into COGS will make your margin reports impossible to compare across promo and non-promo periods.

On a multi-SKU catalog with mixed economics, expect 5-12 points of margin error on individual campaigns — and the error is biggest exactly where it hurts most, on the high-spend creatives scaling a single product. That's why per-SKU landed cost becomes table stakes past about €20k/month in paid spend.

Only if you've snapshotted the cost at order time. If you've been updating Shopify's `cost` field in place without history, old orders will silently revalue against current costs and your historical margin reports will drift. The fix is to start snapshotting now and treat pre-snapshot data as approximate.

Track CAC, channels, and funnel conversion in one place

Metricuno connects ad spend, funnel events, and revenue so you can see CAC by channel, cohort, and campaign — without stitching together five tools.