Skip to main content
The same events can produce different measured quantities depending on the aggregation type. Compare the results to choose the type that matches what you want to measure.

Events received

A tracking API company measures usage with the tracked_pages metric. The customer’s contract contract_example has a monthly billing period, January 1 to January 31, 2027. Your backend sends two events:
Event received #1
Event received #2
The first event is on January 16, the second on January 17.

Result per aggregation type

Weighted sum also accounts for how long the running total applies within the billing period. Here the total is 10 for one day (January 16 to 17), then 30 for the remaining 15 days of January: (10 × 1 day + 30 × 15 days) / 31 days = 14.84.

Next step

Connect your metric to a Product, then configure pricing through a Rate Card.

Aggregation types

Compare the available aggregation types.

Rates

Price the aggregated quantity.

Create a billable metric (API)

POST /billable_metrics

Ingest usage

Send usage events to Lago.