get https://api.chartmogul.com/v1/metrics/ltv
Retrieves the Customer Lifetime Value (LTV), for the specified time period.
Examples
curl -X GET "https://api.chartmogul.com/v1/metrics/ltv" \
-u YOUR_API_KEY: \
-d start-date=2023-07-01 \
-d end-date=2023-08-31 \
-d geo=US \
-d plans=Silver%20Monthly
ChartMogul::Metrics.ltv(
start_date: "2023-07-01",
end_date: "2023-08-31",
geo: "US",
plans: "Silver Monthly",
)
ChartMogul.Metrics.ltv(config, {
"start-date": "2023-07-01",
"end-date": "2023-08-31",
geo: "US",
plans: "Silver Monthly",
});
ChartMogul\Metrics::ltv([
"start-date" => "2023-07-01",
"end-date" => "2023-08-31",
"geo" => "US",
"plans" => "Silver Monthly"
]);
api.MetricsRetrieveLTV(&cm.MetricsFilter{
StartDate: "2023-07-01",
EndDate: "2023-08-31",
Geo: "US",
Plans: "Silver Monthly",
})
chartmogul.Metrics.ltv(
config,
start_date="2023-07-01",
end_date="2023-08-31",
geo="US",
plans="Silver Monthly",
)
Result Format
{
"entries": [
{
"date": "2023-07-31",
"ltv": 25733,
"percentage-change": 0.0
},
{
"date": "2023-08-31",
"ltv": 19473,
"percentage-change": -24.3
}
],
"summary": {
"current": 19473,
"previous": 25733,
"percentage-change": -24.3
}
}
#<ChartMogul::Metrics::LTVs:0x007faf03c4b440
@entries=[
#<ChartMogul::Metrics::LTV:0x007faf03c4b0a8
@date=2023-07-31,
@ltv=25733,
@percentage_change=0
>,
#<ChartMogul::Metrics::LTV:0x007faf03c4aab8
@date=2023-08-31,
@ltv=19473,
@percentage_change=-24.3
>
],
@summary=
#<ChartMogul::Summary:0x007faf03c484c0
@current=19473,
@previous=25733,
@percentage_change=-24.3
>
>
{
entries: [
{
date: "2023-07-31",
ltv: 25733,
"percentage-change": 0.0
},
{
date: "2023-08-31",
ltv: 19473,
"percentage-change": -24.3
}
],
summary: {
current: 19473,
previous: 25733,
"percentage-change": -24.3
}
}
ChartMogul\Metrics\LTVs::__set_state(array(
"entries" => Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" => array(
0 => ChartMogul\Metrics\LTV::__set_state(array(
"date" => "2023-07-31",
"ltv" => 25733.0,
"percentage_change" => 0.0
)),
1 => ChartMogul\Metrics\LTV::__set_state(array(
"date" => "2023-08-31",
"ltv" => 19473.0,
"percentage_change" => -24.3
))
)
)),
"summary" => ChartMogul\Summary::__set_state(array(
"current" => 19473,
"previous" => 25733,
"percentage_change" => -24.3
)),
));
(*chartmogul.LTVResult)(0xc0420b2f00)({
Entries: ([]*chartmogul.LTVMetrics) (len=2) {
(*chartmogul.LTVMetrics)(0xc0421aa0e0)({
Date: (string) (len=10) "2023-07-31",
LTV: (float64) 25733,
PercentageChange: (float64) 0
}),
(*chartmogul.LTVMetrics)(0xc0421aa140)({
Date: (string) (len=10) "2023-08-31",
LTV: (float64) 19473,
PercentageChange: (float64) -24.3
})
},
Summary: (*chartmogul.Summary)(0xc0421aa180)({
Current: (float64) 19473,
Previous: (float64) 25733,
PercentageChange: (float64) -24.3
})
})
Metrics(
entries=[
<Metrics{
date=datetime.date(2023, 7, 31),
ltv=25733.0,
percentage_change=0.0
}>,
<Metrics{
date=datetime.date(2023, 8, 31),
ltv=19473.0,
percentage_change=-24.3
}>
],
summary=<Summary{
current=19473.0,
percentage_change=-24.3,
previous=25733.0
}>
)
In the response, the entries
key contains an object for each month, with the following data:
date
- The date of the end of the monthltv
- The Customer LTV as at the end of the month. This is in your account's selected currency, and is a number of cents. Divide it by 100 to obtain the actual value.percentage-change
- The percentage change between the current LTV and LTV from the previous time interval. Will be set to0.0
if this is the first entry in the response.
The summary
key contains the last month's LTV, the LTV a month before that, and the percentage change between these two measures.