# Ad Metrics Calculator (CPM, CPC, CTR, CPA)

> Computes the standard paid-advertising metrics cost per mille (CPM), cost per click (CPC), click-through rate (CTR), cost per acquisition (CPA) and click-to-conversion rate from campaign spend, impressions, clicks and conversions.

- Calculator id: `ad-metrics` · Category: Business & Marketing (`business`) · Tool name: `calculate_ad_metrics`
- Canonical page: https://tttkmbb.com/business/ad-metrics · This document: https://tttkmbb.com/business/ad-metrics.md · JSON definition: https://tttkmbb.com/business/ad-metrics.json

## Purpose

Computes the standard paid-advertising metrics cost per mille (CPM), cost per click (CPC), click-through rate (CTR), cost per acquisition (CPA) and click-to-conversion rate from campaign spend, impressions, clicks and conversions.

**Use when:** You have raw campaign totals (spend, impressions, clicks, optionally conversions) and need CPM, CPC, CTR, CPA or conversion rate, e.g. to compare channels or report performance.

**Do not use when:** You need revenue-based efficiency (use roas), publisher-side earnings from RPM (use ad-revenue), or conversion rate from site visitors rather than ad clicks (use conversion-rate).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `spend` | number |  | required | Total amount spent on the campaign (any currency; outputs use the same currency). (min 0, max 1000000000000) |
| `impressions` | integer |  | required | Number of times the ad was shown. (> 0, max 10000000000000) |
| `clicks` | integer |  | required | Number of clicks on the ad. (min 0, max 1000000000000) |
| `conversions` | integer |  | optional | Optional number of conversions (purchases, sign-ups) attributed to the campaign; enables CPA and conversion rate. (min 0, max 1000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `cpm` | number |  | spend / impressions × 1000. |
| `cpc` | number |  | spend / clicks (absent when clicks = 0). |
| `ctr_percent` | number | % | clicks / impressions × 100. |
| `cpa` | number |  | spend / conversions (only when conversions > 0). |
| `conversion_rate_percent` | number | % | conversions / clicks × 100 (only when conversions given and clicks > 0). |
| `conversions_per_1000_impressions` | number |  | conversions / impressions × 1000 (only when conversions given). |

## Formula

`CPM = spend / impressions × 1000; CPC = spend / clicks; CTR % = clicks / impressions × 100; CPA = spend / conversions; conversion rate % = conversions / clicks × 100`

## Data Sources

- Google Ads Help – Cost-per-thousand impressions (CPM): Definition — https://support.google.com/google-ads/answer/6310 (reference, retrieved 2026-09-24)
- Google Ads Help – Clickthrough rate (CTR): Definition — https://support.google.com/google-ads/answer/2615875 (reference, retrieved 2026-09-24)
- Wikipedia – Cost per mille — https://en.wikipedia.org/wiki/Cost_per_mille (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ad-metrics?spend=…&impressions=…&clicks=…`
- `POST https://tttkmbb.com/api/v1/calculate/ad-metrics` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ad-metrics · OpenAPI operationId `calculate_ad_metrics` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ad-metrics", "inputs": {…}}`

## Example

- Spend 500, 40,000 impressions, 1,000 clicks, 25 conversions: inputs `{"spend":500,"impressions":40000,"clicks":1000,"conversions":25}` → `{"cpm":12.5,"cpc":0.5,"ctr_percent":2.5,"cpa":20,"conversion_rate_percent":2.5}`
- Spend 1,200, 250,000 impressions, 3,000 clicks, 60 conversions: inputs `{"spend":1200,"impressions":250000,"clicks":3000,"conversions":60}` → `{"cpm":4.8,"cpc":0.4,"ctr_percent":1.2,"cpa":20,"conversion_rate_percent":2}`

```
GET https://tttkmbb.com/api/v1/calculate/ad-metrics?spend=500&impressions=40000&clicks=1000&conversions=25
```

## Limitations

You need revenue-based efficiency (use roas), publisher-side earnings from RPM (use ad-revenue), or conversion rate from site visitors rather than ad clicks (use conversion-rate). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does 'mille' in CPM mean?**

Latin for thousand: CPM is the cost of 1,000 impressions, so spend / impressions × 1000. A CPM of 12.50 means 1.25 cents per impression.

**Is the conversion rate based on clicks or impressions?**

On clicks (conversions / clicks), the convention in Google Ads and most ad platforms. Conversions per 1,000 impressions is reported separately.

**What if clicks are zero?**

CPC and conversion rate are undefined and are omitted; CPM and CTR (0 %) are still returned.

## Related

- [ROAS Calculator](https://tttkmbb.com/business/roas.md) — Revenue-based return on the same ad spend.
- [Conversion Rate Calculator](https://tttkmbb.com/business/conversion-rate.md) — Conversion rate and required traffic from visitors and conversions.
- [Ad Revenue Calculator (RPM)](https://tttkmbb.com/business/ad-revenue.md) — Publisher-side revenue from RPM and page views.
