Customer Churn Rate
GET https://api.chartmogul.com/v1/metrics/customer-churn-rate
Retrieves the Customer Churn Rate for the specified time period.
curl -X GET "https://api.chartmogul.com/v1/metrics/customer-churn-rate" \
-u YOUR_API_KEY: \
-d start-date=2023-07-01 \
-d end-date=2023-08-31 \
-d interval=month \
-d geo=US \
-d plans=Silver%20Monthly
ChartMogul::Metrics.customer_churn_rate(
start_date: "2023-07-01",
end_date: "2023-08-31",
interval: "month",
geo: "US",
plans: "Silver Monthly",
)
ChartMogul.Metrics.customerChurnRate(config, {
"start-date": "2023-07-01",
"end-date": "2023-08-31",
interval: "month",
geo: "US",
plans: "Silver Monthly",
});
ChartMogul\Metrics::customerChurnRate([
"start-date" => "2023-07-01",
"end-date" => "2023-08-31",
"interval" => "month",
"geo" => "US",
"plans" => "Silver Monthly"
]);
api.MetricsRetrieveCustomerChurnRate(&cm.MetricsFilter{
StartDate: "2023-07-01",
EndDate: "2023-08-31",
Interval: "month",
Geo: "US",
Plans: "Silver Monthly",
})
chartmogul.Metrics.customer_churn_rate(
config,
start_date="2023-07-01",
end_date="2023-08-31",
interval="month",
geo="US",
plans="Silver Monthly",
)
{
"entries": [
{
"date": "2023-07-31",
"customer-churn-rate": 8.5,
"percentage-change": 0.0
},
{
"date": "2023-08-31",
"customer-churn-rate": 9.8,
"percentage-change": 2.0
}
],
"summary": {
"current": 9.8,
"previous": 8.5,
"percentage-change": 2.0
}
}
#<ChartMogul::Metrics::CustomerChurnRates:0x007faf03d088d8
@entries=[
#<ChartMogul::Metrics::CustomerChurnRate:0x007faf03d08680
@date=2023-07-31,
@customer_churn_rate=8.5,
@percentage_change=0.0
>,
#<ChartMogul::Metrics::CustomerChurnRate:0x007faf03d08680
@date=2023-08-31,
@customer_churn_rate=9.8,
@percentage_change=2.0
>
],
@summary=
#<ChartMogul::Summary:0x007faf03d01038
@current=9.8,
@previous=8.5,
@percentage_change=2.0
>
>
{
entries: [
{
date: "2023-07-31",
"customer-churn-rate": 8.5,
"percentage-change": 0.0
},
{
date: "2023-08-31",
"customer-churn-rate": 9.8,
"percentage-change": 2.0
}
],
summary: {
current: 9.8,
previous: 8.5,
"percentage-change": 2.0
}
}
ChartMogul\Metrics\CustomerChurnRates::__set_state(array(
"entries" => Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" => array(
0 => ChartMogul\Metrics\CustomerChurnRate::__set_state(array(
"date" => "2023-07-31",
"customer_churn_rate" => 8.5,
"percentage_change" => 0.0
)),
1 => ChartMogul\Metrics\CustomerChurnRate::__set_state(array(
"date" => "2023-08-31",
"customer_churn_rate" => 9.8,
"percentage_change" => 2.0
))
)
)),
"summary" => ChartMogul\Summary::__set_state(array(
"current" => 9.8,
"previous" => 8.5,
"percentage_change" => 2.0
))
));
(*chartmogul.CustomerChurnRateResult)(0xc0420b2f00)({
Entries: ([]*chartmogul.CustomerChurnRateMetrics) (len=2) {
(*chartmogul.CustomerChurnRateMetrics)(0xc0420b3320)({
Date: (string) (len=10) "2023-07-31",
CustomerChurnRate: (float64) 8.5,
PercentageChange: (float64) 0
}),
(*chartmogul.CustomerChurnRateMetrics)(0xc0420b33a0)({
Date: (string) (len=10) "2023-08-31",
CustomerChurnRate: (float64) 9.8,
PercentageChange: (float64) 2
})
},
Summary: (*chartmogul.Summary)(0xc0420b33e0)({
Current: (float64) 0,
Previous: (float64) 0,
PercentageChange: (float64) 0
})
})
Metrics(
entries=[
<Metrics{
customer_churn_rate=8.5,
percentage_change=0.0,
date=datetime.date(2023, 7, 31)
}>,
<Metrics{
customer_churn_rate=9.8,
percentage_change=2.0,
date=datetime.date(2023, 8, 31)
}>
],
summary=<Summary{
current=9.8,
percentage_change=2.0,
previous=8.5
}>
)
Query parameters
start-datedatetime required- The start date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12 end-datedatetime required- The end date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12 intervalstring optional default: "month"- One of
day,week,month(default),quarteroryear geostring optional- A comma-separated list of ISO 3166-1 Alpha-2 formatted country codes to filter the results to, e.g.
US,UK,DE. plansstring optional- A comma-separated list of plan UUIDs, external IDs or names (as configured in your ChartMogul account) to filter the results. Plan UUIDs are accepted with or without the
pl_prefix (e.g.,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,b35fdb9e-1ca2-11ee-90be-6f197565b760). Plan IDs and names are case-sensitive. Spaces in plan names must be URL-encoded (e.g.,Silver%20plan,Gold%20plan,Enterprise%20plan). You can mix plan UUIDs, external IDs and names in a single string, (e.g.,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,gold_plan,Silver%20plan).
Response
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
customer-churn-rate- The customer churn rate at the end of that month, expressed as a percentage.
percentage-change- The percentage change between the current customer churn rate and customer churn rate 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 Customer Churn Rate value, the value a month before that and the percentage change between these two measures.