How to Calculate Shopify Profit Margin With Ad Spend
Calculate what remains from a Shopify order after product, fulfillment, payment, and advertising costs—and separate order-level contribution margin from full-business net margin.
Table of Contents
The short answer
Ad-after order profit = net sales − product cost − fulfillment and shipping subsidy − payment fees − ad cost per order.
Ad-after profit margin = ad-after order profit ÷ net sales × 100.
Use net sales after discounts and refunds, and exclude sales tax collected for a tax authority. This is an order-level contribution calculation: it does not include fixed overhead such as payroll, software subscriptions, or your monthly Shopify plan unless you allocate those costs separately.
You can use our free Shopify profit calculator to enter your selling price, product and shipping costs, actual fee rates, and average ad cost per order. For this simplified calculator, use net merchandise sales as the selling-price input; it has no separate inputs for tax, refunds, or customer-paid shipping. The result is only as useful as the inputs and fee setup you choose.
What “profit margin with ad spend” should mean
Shopify revenue, ROAS, and profit answer different questions. Revenue is sales collected for orders. ROAS compares attributed revenue with ad spend. Neither tells you what remains after the costs required to fulfill and acquire each order.
For a practical store-level check, calculate ad-after contribution margin per order. Start with the order’s net sales, subtract variable costs, then subtract the advertising cost assigned to that order. Compare the remaining profit with net sales to get a percentage.
This is not necessarily your accounting net profit margin. A complete period-level profit calculation also accounts for fixed and operating expenses such as salaries, rent, software, agency retainers, and other overhead. Keep the two metrics separate so a positive order contribution does not get mistaken for a profitable business.
Calculate the ad cost assigned to one order
If you have campaign spend and the number of orders attributed to those campaigns, a simple working estimate is:
Ad cost per attributed order = ad spend ÷ attributed orders
For example, $1,200 ÷ 100 attributed orders = $12 per order. Keep the time period, currency, campaign scope, and attribution model consistent. Shopify reports can use different attribution models, and paid platforms can report different conversion totals; Shopify documents its marketing reporting and attribution options in its marketing reports guide. Use one clearly stated source of truth for the article’s calculation rather than mixing ad-platform revenue with Shopify order counts.
This average is useful for a first pass, but it can hide differences between campaigns, new and returning customers, and products with different margins. If you are evaluating a specific campaign, use that campaign’s spend and attributed orders. For a broader acquisition view, use a consistently calculated blended cost per acquired customer and label it as blended CAC rather than campaign CPA.
Work through a Shopify order example
Assume one order has $50 in net sales after discounts and refunds, with no sales tax included in that amount. The order has $10 product cost, $5 fulfillment and shipping subsidy, $1.75 in actual payment and applicable Shopify transaction fees combined, and $12 of advertising cost assigned to the order.
| Item | Amount |
|---|---|
| Net sales | $50.00 |
| Product cost | −$10.00 |
| Fulfillment and shipping subsidy | −$5.00 |
| Actual payment / Shopify transaction fees | −$1.75 |
| Ad cost per order | −$12.00 |
| Ad-after order profit | $21.25 |
$50 − $10 − $5 − $1.75 − $12 = $21.25
Then divide the remaining $21.25 by $50 net sales:
$21.25 ÷ $50 × 100 = 42.5% ad-after contribution margin
The $1.75 fee is an illustrative combined amount, not a recommended Shopify or card-processing rate. Enter the fees that actually apply to your store and payment route. Shopify explains that Shopify Payments has card-processing fees, while third-party providers can also trigger a separate Shopify transaction fee; the exact treatment depends on payment setup and plan. Check Shopify’s current Shopify Payments fee documentation and third-party transaction fee documentation before using a fee assumption.
Make the inputs match your store
Use the same sales basis throughout
Start with net sales after discounts and refunded sales, not a tax-inclusive checkout total. Shopify distinguishes net sales from total sales, and total sales can include shipping and taxes; see its marketing performance metric definitions. Shopify notes that sellers may need to collect sales tax and remit it to government, so treat collected tax as money set aside for that obligation rather than revenue available to cover ads or product costs (Shopify tax overview). If customer-paid shipping is material, include shipping revenue and shipping expense consistently in your own model.
Count each payment fee once
Payment costs are not identical across stores. Shopify Payments card-processing fees and Shopify third-party transaction fees are separate charges with different rules. The linked DTCStack calculator currently has separate fields for a Shopify transaction fee and a Stripe processing fee. Only use the fields if they match the actual charges on your order; do not enter both just because the tool has both fields. Shopify states that third-party transaction fees can be in addition to a provider’s processing fee. Review your Shopify bill and provider payout statements instead of copying a generic rate from an article.
Separate variable costs from fixed overhead
Include costs that change with the order: product cost, pick-and-pack, shipping subsidy, packaging, payment processing, refunds or expected return costs, and ad acquisition cost. Do not silently mix a monthly subscription or payroll amount into per-order costs. To estimate a monthly operating margin, first total order contribution for the period, then subtract fixed operating expenses once.
Compare your margin with ROAS carefully
ROAS is ad-attributed revenue ÷ ad spend. In the example, if the $50 order is fully attributed to $12 of ad spend, ROAS is 4.17x. That does not mean the profit margin is 417%; it only compares revenue with advertising cost.
Before ads, the example order contributes $33.25 ($50 − $10 − $5 − $1.75). The simplified break-even ROAS before fixed overhead is net sales ÷ pre-ad contribution, or about 1.50x. Actual ROAS above that level can leave positive contribution, but refunds, attribution differences, discount mix, and overhead still matter.
Use the margin calculator with ad spend to compare your own ad cost per order with your product, fulfillment, and fee assumptions. For campaigns, recalculate when the time window, attributed orders, or product mix changes; a single store-wide average can conceal unprofitable segments.
Common mistakes to avoid
- Dividing profit by gross checkout total that includes sales tax.
- Treating ROAS as a profit-margin percentage.
- Subtracting the same payment processing fee twice.
- Using total ad spend with only a subset of attributed orders, or changing attribution models between periods.
- Calling order contribution margin “net profit” without subtracting fixed operating expenses.
- Applying one average ad cost to products or customer segments with very different acquisition costs.
Frequently asked questions
Does Shopify profit margin include ad spend?
Not automatically. A margin calculation includes ad spend only when you subtract an ad cost assigned to the order or period. State whether the result is before advertising or after advertising.
Should I include sales tax in the profit-margin formula?
For a merchant operating-margin calculation, use sales revenue excluding sales tax collected on behalf of a tax authority. Keep shipping revenue treatment consistent with the shipping cost you include.
How do I calculate ad cost per Shopify order?
Divide the ad spend for a defined campaign and time period by the orders attributed to that same scope and period. Record the attribution model because different platforms and reports can assign conversions differently.
Is contribution margin the same as net profit margin?
No. Order contribution subtracts selected variable costs from sales. Net profit margin also reflects operating expenses, taxes, interest, and other items for a defined accounting period.
Do Shopify Payments and Stripe fees both belong in the calculation?
Use the fees that actually apply to the payment route for each order. Do not add a separate Stripe processing fee when you are entering Shopify Payments’ processing fee, and check whether a separate Shopify transaction fee applies to an external provider.