> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contribution margin (CM1–CM4)

> Set up contribution margin in Upstack. Enter your product costs and other expenses once, and Upstack shows CM1 through CM4 — your true profit after each layer of costs.

Revenue and ROAS tell you what you sold. Contribution margin tells you what you kept. Upstack calculates four tiers of it, each one subtracting more costs:

| Tier | What comes out | What it answers |
| - | - | - |
| **CM1** | Product cost (COGS) | Are my products profitable? |
| **CM2** | Shipping, fulfillment, payment fees | Am I profitable after delivering the order? |
| **CM3** | Marketing and ad spend | Am I profitable after advertising? |
| **CM4** | Operating expenses, agency fees, other | Am I profitable as a business? |

## Set it up in three steps

<Steps>
  <Step title="Enter your product costs in Shopify">
    In **Shopify Admin → Products**, open a product and fill in **Cost per item** for each variant. That's it — Upstack pulls the costs in automatically.

    <Info>
      After you enter costs, give Upstack some time to fill in CM1 for your past orders. It happens automatically.
    </Info>
  </Step>

  <Step title="Add your other costs in Upstack">
    Open **Settings → Cost settings** and add what it costs to run the business: shipping, payment fees, order costs, and any fixed or variable costs. Every cost you add gets a category, and the category decides which tier it reduces — the same four tiers as the table above.

    See [Cost settings](/analytics/cost-settings) for a walkthrough of every cost type.
  </Step>

  <Step title="Connect your ad accounts">
    Ad spend from connected platforms (Meta, Google, TikTok) flows in automatically and counts toward CM3. For channels Upstack doesn't connect to — influencers, podcasts, and similar — add the spend under **Settings → Cost settings** as a fixed or variable cost.
  </Step>
</Steps>

## Seeing it in the dashboard

The **P\&L** pages in Upstack put your costs into a live profit view:

* **P\&L dashboard** — your profit at a glance: revenue, CM1–CM4, and a waterfall chart showing where money goes from gross revenue down to operating profit.
* **Income statement** — the full line-by-line breakdown: gross revenue, each deduction group (fulfillment and fees, marketing and ads, operating costs), and the margin left at every tier.

Both respect your date range, filters, and comparison period, and they update as soon as your costs change.

## Related

<CardGroup cols={2}>
  <Card title="Cost settings" icon="coins" href="/analytics/cost-settings">
    Set up product, order, shipping, gateway, fixed, and variable costs in detail.
  </Card>

  <Card title="Attribution and reporting" icon="chart-line" href="/concepts/attribution-and-reporting">
    How Upstack attributes conversions and calculates reporting metrics.
  </Card>

  <Card title="Attribution reporting dashboard" icon="table-columns" href="/analytics/attribution-reporting">
    Compare attribution models and channel credit allocation.
  </Card>

  <Card title="Contribution margin metrics" icon="layer-group" href="/reference/metrics/orders/contribution-margin">
    Every CM1–CM4 measure you can report on, per order and per customer type.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.