LTV
GET https://api.chartmogul.com/v1/metrics/ltv
Retrieves the Customer Lifetime Value (LTV), for the specified time period.
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",
)
{
"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
}>
)
Query parameters
start-date
datetime required- The start date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12
end-date
datetime required- The end date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12
geo
string- A comma-separated list of ISO 3166-1 Alpha-2 formatted country codes to filter the results to, e.g.
US,UK,DE
. plans
string- A comma-separated list of plan names (as configured in your ChartMogul account), UUIDs and external IDs to filter the results. Spaces in plan names must be URL-encoded (e.g.,
Silver%20plan,Gold%20plan,Enterprise%20plan
). Plan UUIDs are accepted with or without thepl_
prefix (e.g.,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,b35fdb9e-1ca2-11ee-90be-6f197565b760
). Plan names and IDs are case-sensitive. You can mix plan names, UUIDs and external IDs in a single string, (e.g.,Silver%20plan,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,gold_plan
).
In the response, the entries
key contains an object for each month, with the following data:
date
- The date of the end of the month
ltv
- 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 to 0.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.