Revenue
Revenue represents the total income generated from purchases on your platform. It includes taxes and shipping if configured that way. Tracking revenue helps understand sales trends, optimize performance, and measure ROI.
Metric model
- Name
metric
- Type
- string
- Description
Always
revenue
for this metric.
- Name
value
- Type
- float
- Description
Revenue value for the current period.
- Name
previous
- Type
- float
- Description
Revenue value from the previous comparable period.
- Name
change
- Type
- float
- Description
Percent change from previous to current period.
- Name
formattedValue
- Type
- string
- Description
Human-friendly formatted revenue (e.g., €8.505,01).
- Name
formattedPrevious
- Type
- string
- Description
Human-friendly formatted previous revenue.
- Name
period.id
- Type
- string
- Description
Period identifier (e.g.,
7d
).
- Name
period.name
- Type
- string
- Description
Name of the period (e.g.,
Last 7 days
).
- Name
periodRange.current.start
- Type
- string
- Description
Start of the current date range (ISO timestamp).
- Name
periodRange.current.end
- Type
- string
- Description
End of the current date range (ISO timestamp).
- Name
periodRange.previous.start
- Type
- string
- Description
Start of the previous date range (ISO timestamp).
- Name
periodRange.previous.end
- Type
- string
- Description
End of the previous date range (ISO timestamp).
- Name
performance.duration
- Type
- float
- Description
Time taken to compute the metric (in ms).
- Name
performance.formatted
- Type
- string
- Description
Formatted duration (e.g.,
568 ms
).
Example API usage
Fetch Revenue Metric
GET /api/metrics/revenue?period=7d
Response
{
"metric": "revenue",
"value": 8505.01,
"previous": 9132.79,
"change": -6.87,
"formattedValue": "€ 8.505,01",
"formattedPrevious": "€ 9.132,79",
"period": {
"id": "7d",
"name": "Last 7 days"
},
"periodRange": {
"current": {
"start": "2025-03-16T08:52:16.069Z",
"end": "2025-03-23T08:52:16.068Z"
},
"previous": {
"start": "2025-03-09T08:52:16.069Z",
"end": "2025-03-16T08:52:16.068Z"
}
},
"performance": {
"duration": 567.65,
"formatted": "568 ms"
}
}
Use cases
- Understand revenue trends week-over-week
- Feed into LTV and ROAS models
- Compare revenue growth by segment or campaign