Conversion Rate
The Conversion Rate metric represents the percentage of visitors who completed a purchase. It helps evaluate the effectiveness of your site or campaign in turning traffic into customers.
Metric model
- Name
metric
- Type
- string
- Description
Always
conversion_rate
for this metric.
- Name
value
- Type
- float
- Description
Conversion rate for the current period (e.g., 0.53).
- Name
previous
- Type
- float
- Description
Conversion rate from the previous period.
- Name
change
- Type
- float
- Description
Percent change compared to the previous period.
- Name
formattedValue
- Type
- string
- Description
Human-readable current conversion rate.
- Name
formattedPrevious
- Type
- string
- Description
Human-readable previous conversion rate.
- Name
period.id
- Type
- string
- Description
Time period identifier (e.g.,
7d
).
- Name
period.name
- Type
- string
- Description
Label for the selected time period.
- Name
periodRange.current.start
- Type
- string
- Description
Start of the current period (ISO 8601).
- Name
periodRange.current.end
- Type
- string
- Description
End of the current period (ISO 8601).
- Name
periodRange.previous.start
- Type
- string
- Description
Start of the previous period (ISO 8601).
- Name
periodRange.previous.end
- Type
- string
- Description
End of the previous period (ISO 8601).
- Name
performance.duration
- Type
- float
- Description
Time taken to retrieve the metric in milliseconds.
- Name
performance.formatted
- Type
- string
- Description
Human-readable duration string (e.g.,
838 ms
).
Retrieve conversion rate
This endpoint returns the conversion rate metric for a selected period.
Optional query parameters
- Name
period
- Type
- string
- Description
Common periods:
today
yesterday
7d
30d
this_month
Request
curl -G http://localhost:3000/api/metrics/conversion_rate \
-H "Authorization: Bearer {token}" \
-d period=7d
Response
{
"metric": "conversion_rate",
"value": 0.53,
"previous": 0.54,
"change": -2.17,
"formattedValue": "0,53%",
"formattedPrevious": "0,54%",
"period": {
"id": "7d",
"name": "Last 7 days"
},
"periodRange": {
"current": {
"start": "2025-03-16T08:50:55.028Z",
"end": "2025-03-23T08:50:55.027Z"
},
"previous": {
"start": "2025-03-09T08:50:55.028Z",
"end": "2025-03-16T08:50:55.027Z"
}
},
"performance": {
"duration": 838.42,
"formatted": "838 ms"
}
}
Use cases
- Measure how effectively traffic converts into paying customers
- Analyze drop-off rates across channels and pages
- Support optimization efforts in marketing and UX