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

# Correlate Cloud Costs with Active Users Using Amplitude

> Understand whether your cloud costs scale with your business. Connect Amplitude active users to Costory and track cost per thousand users over time.

Cloud cost per active user is a quick way to track if your infrastructure is scaling the way it should. For example, if cloud spend rises by 30% but your active users increase by 50%, your cost per user is actually going down, your efficiency is improving. But if user count stays flat and costs still go up 30%, something’s off and worth a closer look.

To really see what’s happening, always link your spend to a core business metric. This is your <Tooltip tip="Financial metrics expressed on a per-unit basis: cost per customer, cost per API call, cost per transaction." cta="See Glossary" href="/docs/glossary#unit-economics">unit economics</Tooltip>.

| Costs | Users | Cost / 1k users | Verdict                |
| ----- | ----- | --------------- | ---------------------- |
| +30%  | +50%  | ↓               | Scaling well           |
| +30%  | +30%  | →               | Flat, no gain, no loss |
| +30%  | +10%  | ↑               | Drifting, investigate  |

The right metric is the one that correlates most closely with your cloud spend: when it goes up, costs should go up proportionally. If they don't, you've found a problem worth investigating.

Start by asking: **what does my infrastructure actually serve?**

* **SaaS / Product**: DAU or MAU.
* **E-commerce**: orders processed.
* **Fintech**: transactions processed.
* **API platform**: API requests.
* **Marketing**: campaigns or emails sent.
* **Ad tech**: impressions served or ad revenue.
* **Data / Analytics**: queries or pipelines executed.
* **Streaming / Gaming**: hours streamed or concurrent players.

<Tip>
  Don't stop at the global ratio. Break it down **per team, per region, or per workflow step**. A healthy global number can hide that one team or one region is drifting badly.
</Tip>

This guide walks through the setup with **active users from Amplitude**, a hands-on example of [tracking unit economics](/automate-reporting/unit-economics). The same approach works with any metric you can push to Costory's [Metric Connector](https://app.costory.io/sign-up).

## What you'll get

* A chart that overlays production costs with active users and cost per thousand users. Divergences are visible at a glance.
* Recurring Cost Reports showing cost and user trends side by side, without spreadsheet work.
* An alert that fires when your cost per thousand active users crosses a threshold you define.

## Prerequisites

* **Amplitude API credentials**: API key + secret from Amplitude > Settings > Projects > \[Your Project] > General. Used by the [Metric Connector](https://app.costory.io/sign-up) to pull daily active users into Costory.

* **A production cost filter**: a where clause in [Explorer](/features/cost-explorer) that isolates prod workloads. Exclude R\&D, staging, and marketplace purchases, as they distort the unit cost calculation.

## How to track cloud cost per active user

<Steps>
  <Step title="Import active users from Amplitude">
    Open the [Metric Connector](https://app.costory.io/sign-up), enter your API key and secret.

    Set the aggregation to **Average**. You want the typical user count over the period, not a peak or a sum.

    <Info>
      A metric can include one or more **group-by dimensions** (e.g., region, plan tier, team). When you add a group-by, Costory imports the metric broken down by that dimension, so you can later compute cost per thousand users **per segment** instead of only at the global level.
    </Info>

    Once imported, go to **Data Sources > Metrics**. You'll see "Daily Active Users" listed with an **Active** status. Click the chart icon on that row to open the metric in [Explorer](/features/cost-explorer). Your active users are loaded as **query a**.

    <Frame caption="Open Daily Active Users in Explorer">
      <img src="https://mintcdn.com/costory/O-vvHx6D50fNZuKd/use-cases/amplitude/part1.gif?s=32bbd68763392df97c0c9c409740cbe3" alt="Metrics datasources page, opening Daily Active Users in Explorer" width="764" height="480" data-path="use-cases/amplitude/part1.gif" />
    </Frame>

    <Info>
      Not using Amplitude? Import from [CSV](/setup/usage-metrics#csv), [Google Sheets](/setup/usage-metrics#google-sheet), [Datadog](/setup/usage-metrics#datadog), [BigQuery](/setup/usage-metrics#bigquery), or [S3 Parquet](/setup/usage-metrics#parquet-file-aws-s3). Full list: [Usage & Metrics Providers](/setup/usage-metrics).
    </Info>
  </Step>

  <Step title="Build the cost per thousand users formula">
    Your active users are already loaded as **query a**. Add a Cost query as **query b**, filtered to production, for example `Environment in Production`. Then add a formula **`b / (a / 1000)`** to get cost per thousand users. Dividing by 1,000 gives a more readable number than cost per individual user.

    <Tip>
      Keep the cost scope tight. If you include non-production spend (R\&D, staging, marketplace), the ratio will fluctuate for reasons unrelated to user-facing efficiency.
    </Tip>

    <Frame caption="Add production costs alongside active users and define the cost-per-1k-users formula">
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/costory/use-cases/amplitude/part2.gif" alt="Explorer adding a Cost query filtered to production, then defining the formula b / (a / 1000) for cost per thousand active users" />
    </Frame>
  </Step>

  <Step title="Save as a view and schedule to Slack">
    Save as a <Tooltip tip="A saved configuration of Explorer with specific metrics, filters, group-bys, date ranges, formulas, and event context." cta="See Glossary" href="/docs/glossary#view">View</Tooltip>, for example "Production Cost per Thousand Users", and schedule weekly or monthly delivery to Slack.

    <Frame caption="Save the view and schedule recurring delivery">
      <img src="https://mintcdn.com/costory/O-vvHx6D50fNZuKd/use-cases/amplitude/part3.gif?s=bf7cb2f09ae59eae11ec242dfafe0fcd" alt="Saving the Production Cost per Thousand Users view and scheduling a recurring Slack report" width="1148" height="720" data-path="use-cases/amplitude/part3.gif" />
    </Frame>
  </Step>

  <Step title="Set an alert for efficiency regressions">
    Click the bell icon on the same view. Set a threshold on cost per thousand users. Costory notifies you when the ratio crosses it, so you catch efficiency regressions before they compound.

    <Frame caption="Set an alert on cost per thousand users">
      <img src="https://mintcdn.com/costory/O-vvHx6D50fNZuKd/use-cases/amplitude/part5.gif?s=7f80831adc23befa7935043370222945" alt="Setting an alert threshold on cost per thousand users" width="1148" height="720" data-path="use-cases/amplitude/part5.gif" />
    </Frame>
  </Step>
</Steps>

## FAQ

<AccordionGroup>
  <Accordion title="Which business metric should I use for unit economics?">
    Pick the metric that correlates most closely with your cloud spend. For most SaaS products, that's daily or monthly active users. For e-commerce it may be orders processed, for API platforms it's API requests, and for data platforms it's queries executed. If the metric goes up and costs go up proportionally, you've found the right one.
  </Accordion>

  <Accordion title="Can I use this without Amplitude?">
    Yes. Costory's Metric Connector supports [CSV](/setup/usage-metrics#csv), [Google Sheets](/setup/usage-metrics#google-sheet), [Datadog](/setup/usage-metrics#datadog), [BigQuery](/setup/usage-metrics#bigquery), [S3 Parquet](/setup/usage-metrics#parquet-file-aws-s3), and more. See [Usage & Metrics Providers](/setup/usage-metrics) for the full list.
  </Accordion>

  <Accordion title="How often does the Amplitude metric sync?">
    Costory syncs Amplitude data daily. The metric updates automatically so your cost-per-user ratio stays current without manual intervention.
  </Accordion>

  <Accordion title="Should I use Average or Sum for the aggregation?">
    Use **Average** for user counts. It gives you the typical user count over the period rather than a peak or cumulative total. Use **Sum** for volume-based metrics like API requests or transactions processed.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={3}>
  <Card title="Cost Reports" icon="paper-plane" href="/features/slack-reports">
    Send weekly or monthly cost reports to your team channels.
  </Card>

  <Card title="Explore cost drivers" icon="chart-line" href="/features/cost-explorer">
    Drill into cost spikes and validate trends across services.
  </Card>

  <Card title="Improve tagging" icon="tags" href="/features/tagging">
    Clean up labels and boost attribution accuracy.
  </Card>
</CardGroup>
