> ## 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 tracks whether your infrastructure scales the way it should. If spend rises 30% while active users grow 50%, cost per user drops and efficiency improves. If users stay flat and costs still climb 30%, that gap is worth a look.

[Track cloud cost per active user with Amplitude](https://www.youtube.com/embed/GljU8_UOA8w)

Link your spend to a core business metric to see what is happening. That ratio is your unit economics (Financial metrics expressed on a per-unit basis: cost per customer, cost per API call, cost per transaction.).

| Costs | Users | Cost / 1k users | Verdict |
| - | - | - | - |
| +30% | +50% | down | Scaling well |
| +30% | +30% | flat | No gain, no loss |
| +30% | +10% | up | Drifting, investigate |

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

Pick the metric that maps to what your infrastructure serves:

* **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.

This guide walks through the setup with **active users from Amplitude**, a hands-on example of [tracking unit economics](https://docs.costory.io/automate-reporting/unit-economics.md). The same approach works with any metric you connect under **Integrations** > **External metric**.

## 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 [Amplitude connector](https://docs.costory.io/setup/usage-metrics/amplitude.md) to query daily active users live in Costory.

* **A production cost filter**: a where clause in [Explorer](https://docs.costory.io/features/cost-explorer.md) 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

**1. Connect Amplitude and query active users**

Go to [Integrations](https://app.costory.io/integration), click **+ Add integration**, then under **External metric** choose **Amplitude**. Enter your API key, secret key, and region. See [Amplitude](https://docs.costory.io/setup/usage-metrics/amplitude.md).&#x20;

Click **Explore your data**, switch to **Advanced**, then **+ Add Metric**. Open **integrations**, pick Amplitude, and add active users as **query a**. Set the aggregation to **Average**. You want the typical user count over the period, not a peak or a sum.

> [!NOTE]
>
> A metric can include one or more **group-by dimensions** (e.g., region, plan tier, team). When you add a group-by, Costory queries 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.

> [!NOTE]
>
> Not using Amplitude? Connect any source on the [External metric](https://docs.costory.io/setup/usage-metrics) grid: Datadog, Datadog CI Visibility, BigQuery, Google Sheets, Tsuga, CloudWatch, or S3.

**2. 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]
>
> You can build this cost-per-1k-users view from chat with the [Costory MCP](https://docs.costory.io/features/mcp.md): "plot my production cost against Daily Active Users and add a formula for cost per thousand users, then save it as a dashboard."

**3. Save as a view and schedule to Slack**

Save as a View (A saved configuration of Explorer with specific metrics, filters, group-bys, date ranges, formulas, and event context.), for example "Production Cost per Thousand Users", and schedule weekly or monthly delivery to Slack.

**4. 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.

## FAQ

> [accordion] 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] Can I use this without Amplitude?
>
> Yes. Connect any source on the [External metric](https://docs.costory.io/setup/usage-metrics) grid: Datadog, Datadog CI Visibility, BigQuery, Google Sheets, Tsuga, CloudWatch, or S3.

> [accordion] How often does the Amplitude metric update?
>
> Queries run live. Costory does not sync an Amplitude time series to BigQuery.

> [accordion] 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.

## Next steps

> [card] [Cost Reports](https://docs.costory.io/features/slack-reports.md)
>
> Send weekly or monthly cost reports to your team channels.

> [card] [Explore cost drivers](https://docs.costory.io/features/cost-explorer.md)
>
> Drill into cost spikes and validate trends across services.

> [card] [Improve tagging](https://docs.costory.io/features/tagging.md)
>
> Clean up labels and boost attribution accuracy.


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