Customer Count

Retrieves the number of active customers, for the specified time period.

Examples
curl -X GET "https://api.chartmogul.com/v1/metrics/customer-count" \
     -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_count(
  start_date: "2023-07-01",
  end_date: "2023-08-31",
  interval: "month",
  geo: "US",
  plans: "Silver Monthly",
)
ChartMogul.Metrics.customerCount(config, {
  "start-date": "2023-07-01",
  "end-date": "2023-08-31",
  interval: "month",
  geo: "US",
  plans: "Silver Monthly",
});
ChartMogul\Metrics::customerCount([
  "start-date" => "2023-07-01",
  "end-date" => "2023-08-31",
  "interval" => "month",
  "geo" => "US",
  "plans" => "Silver Monthly"
]);
api.MetricsRetrieveCustomerCount(&cm.MetricsFilter{
  StartDate: "2023-07-01",
  EndDate:   "2023-08-31",
  Interval:  "month",
  Geo:       "US",
  Plans:     "Silver Monthly",
})
chartmogul.Metrics.customer_count(
  config,
  start_date="2023-07-01",
  end_date="2023-08-31",
  interval="month",
  geo="US",
  plans="Silver Monthly",
)
Result Format
{
  "entries": [
    {
      "date": "2023-07-31",
      "customers": 379,
      "percentage-change": 0.0
    },
    {
      "date": "2023-08-31",
      "customers": 382,
      "percentage-change": 0.8
    }
  ],
  "summary": {
    "current": 382,
    "previous": 379,
    "percentage-change": 0.8
  }
}
#<ChartMogul::Metrics::CustomerCounts:0x007fa4ec4605d0 
@entries=[
  #<ChartMogul::Metrics::CustomerCount:0x007fa4ec4602d8 
    @date=2023-07-31, 
    @customers=379,
    @percentage_change=0.0
  >,
  #<ChartMogul::Metrics::CustomerCount:0x007fa4ec4602d8 
    @date=2023-08-31, 
    @customers=382,
    @percentage_change=0.8
  >
], 
@summary=
  #<ChartMogul::Summary:0x007fa4ec45a338
    @current=382,
    @previous=379,
    @percentage_change=0.8
  >
>
{
  entries: [
    {
      date: "2023-07-31",
      customers: 379,
      "percentage-change": 0.0
    },
    {
      date: "2023-08-31",
      customers: 382,
      "percentage-change": 0.8
    }
  ],
  summary: {
    current: 382,
    previous: 379,
    "percentage-change": 0.8
  }
}
ChartMogul\Metrics\CustomerCounts::__set_state(array(
  "entries" => Doctrine\Common\Collections\ArrayCollection::__set_state(array(
    "elements" => array(
      0 => ChartMogul\Metrics\CustomerCount::__set_state(array(
        "date" => "2023-07-31",
        "customers" => 379,
        "percentage_change" => 0.0
      )),
      1 => ChartMogul\Metrics\CustomerCount::__set_state(array(
        "date" => "2023-08-31",
        "customers" => 382,
        "percentage_change" => 0.8
      ))
    )
  )),
  "summary" => ChartMogul\Summary::__set_state(array(
    "current" => 382,
    "previous" => 379,
    "percentage_change" => 0.8
  ))
));
(*chartmogul.CustomerCountResult)(0xc0420c8ba0)({
  Entries: ([]*chartmogul.CustomerCountMetrics) (len=2) {
    (*chartmogul.CustomerCountMetrics)(0xc04200a480)({
      Date: (string) (len=10) "2023-07-31",
      Customers: (uint32) 379,
      PercentageChange: (float64) 0
    }),
    (*chartmogul.CustomerCountMetrics)(0xc04200a4e0)({
      Date: (string) (len=10) "2023-08-31",
      Customers: (uint32) 382,
      PercentageChange: (float64) 0.8
    })
  },
  Summary: (*chartmogul.Summary)(0xc04200a520)({
    Current: (float64) 382,
    Previous: (float64) 379,
    PercentageChange: (float64) 0.8
  })
})
Metrics(
  entries=[
    <Metrics{
      customers=379.0,
      percentage_change=0.0,
      date=datetime.date(2023, 7, 31)
    }>, 
    <Metrics{
      customers=382.0,
      percentage_change=0.8,
      date=datetime.date(2023, 8, 31)
    }>
  ], 
  summary=<Summary{
    current=382.0, 
    percentage_change=0.8, 
    previous=379.0
  }>
)

In the response, the entries key contains an object for each interval, with the following data:

  • date - The date of the end of the interval
  • customers - The number of active customers in your account as at the end of the interval.
    • percentage-change - The percentage change between the current active customers and active customers 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 current Customer Count value, the value 30 days ago, and the percentage change between these two measures.

Language
Credentials
Basic
base64
: