gross revenue − discounts − refundsTrack tax, duties, shipping charged, tips, fees, and gift-card treatment separately. Shopify report terms can use different components and dates, so do not map “total sales” to net revenue by name alone.
Shopify supplies essential order and sales facts, but contribution margin also needs a declared cost boundary, cost rules or product costs, operational cost evidence, currency policy, materialization, and validation.
Start at order-line grain, reconcile each line to its order, and calculate net revenue after discounts and refunds. Subtract COGS and the variable costs included in your policy. Roll up compatible amounts to order grain, then compute contribution margin rate from summed contribution profit divided by summed net revenue.
The exact boundary is a management policy, not a universal Shopify field. Keep the components separate so the result can be reviewed, recomputed, and compared with the source.
gross revenue − discounts − refundsTrack tax, duties, shipping charged, tips, fees, and gift-card treatment separately. Shopify report terms can use different components and dates, so do not map “total sales” to net revenue by name alone.
net revenue − COGSCOGS needs a product or variant cost basis with effective dates, currency, and provenance. A current cost applied to an old order can rewrite history.
net revenue − COGS − included variable costsVariable costs may include payment fees, shipping, pick-and-pack, fulfillment, marketplace fees, return handling, variable support, and paid media.
sum(contribution profit) ÷ sum(net revenue)Recompute after aggregation. Never average line-, order-, day-, SKU-, or channel-level margin rates.
| Component | Likely evidence | Required control | Missing-data behavior |
|---|---|---|---|
| Orders and order lines | Shopify order identity, line identity, product or variant, quantity, timestamps, channel, status, and currency. | Prove unique line and order grain; retain account, store, and source scope. | Block profit for rows without safe order identity or revenue grain. |
| Revenue and discounts | Shopify order and line amounts plus discount allocations. | Document product, shipping, tax, duties, tips, and gift-card policy. | Do not silently replace a missing component with zero. |
| Refunds and reversals | Order refund fields and refund or reversal events with affected order identity. | Choose original-order or event-date reporting and prevent duplicated gross revenue. | Mark recent cohorts incomplete until the selected return window closes. |
| COGS | Provider product cost, product cost snapshot, ERP evidence, or configured cost rule. | Match product or variant, effective date, scope, method, and currency. | Show missing or estimated cost status; do not claim publishable profit. |
| Shipping and fulfillment cost | Carrier, 3PL, warehouse, fulfillment, or configured cost rules. | Separate customer shipping revenue from merchant shipping and handling cost. | Label the result partial if these costs belong in the policy but are absent. |
| Payment and marketplace fees | Payment processor, finance report, reconciliation, marketplace settlement, or rule. | Use transaction-level evidence where possible; distinguish payment from sales reporting. | Keep payment-fee completeness visible rather than assuming a default is actual. |
| Paid media | Ad-platform spend at compatible account, date, market, and currency scope. | Decide whether paid media is a period-level expense or allocated to orders using an approved model. | Do not assign platform-attributed revenue as observed Shopify revenue. |
Review the Shopify connector and the Semantic Contract Library before selecting fields. Source registration does not prove a profit model is materialized or ready for a particular account.
Metric Hive has backend query and semantic contracts for the following modeled datasets. That implementation evidence is not the same as broad customer availability.
commerce_cost_rule_latest represents governed cost-rule configuration and completeness evidence, not a historical fact to sum.
commerce_order_line_profit_daily carries additive revenue, cost, and profit amounts plus cost and profit completeness and provenance fields at line-profit grain.
commerce_order_profit_daily provides order-level profit amounts and ratios recomputed from compatible bases, with order identity and validation requirements.
| Failure | Effect | Control |
|---|---|---|
| Current COGS on old orders | Historical product margin changes when the current product cost changes. | Use an effective-dated cost snapshot or rule and preserve its model version. |
| Order amount repeated per line | Revenue and profit multiply by the number of order lines. | Use line-native revenue or allocate order-level components so lines sum back to the order. |
| Refunds on the wrong basis | Order cohorts and daily profit disagree, especially around late returns. | Separate refund-event date from the original order date and choose the reporting policy explicitly. |
| Missing costs treated as zero | Profit appears complete and inflated. | Carry cost and profit completeness status; block or label partial outputs. |
| Mixed currencies summed | A numeric total has no coherent monetary meaning. | Group by original currency or apply an approved time-aware FX policy. |
| Platform revenue used as store revenue | Attribution overlap and reporting rules contaminate the commerce numerator. | Use observed Shopify revenue for the commerce model; keep attributed metrics separately labeled. |
Shopify reporting terminology and behavior can change. Confirm current definitions for gross sales, net sales, total sales, reversals, refund dates, order edits, report rows, payments, and finance reports before mapping them.
Test a transparent revenue and variable-cost waterfall locally in your browser.
Choose the cost boundary and understand CAC, payback, SKU grain, and allocations.
Compare net revenue, gross profit, contribution profit, and related rates.
Metric Hive can evaluate Shopify source coverage and the Profit Foundation requirements, but it should not show trusted profit KPIs until materialization and validation evidence exists for the account. Some Shopify contribution-margin workflows may require a guided pilot; confirm readiness and availability before relying on them operationally.