Skip to main content

customerAnalytics

Requires at least one of the permissions analytics:sales:read or dashboard:main:read.

Customer analytics for a period. Limited to the customers you may see.. Needs the sales analytics or dashboard read permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query CustomerAnalytics($period: AnalyticsPeriod!) {
customerAnalytics(period: $period) {
activeCustomers
averageOrdersPerCustomer
churnRate
customerLifetimeValue
newCustomers
totalCustomers
customerGrowth {
newCustomers
period
totalCustomers
}
}
}

Variables:

{
"period": "LAST_6_MONTHS"
}

Response:

{
"data": {
"customerAnalytics": {
"activeCustomers": 0,
"averageOrdersPerCustomer": 0,
"churnRate": 0,
"customerLifetimeValue": 0,
"newCustomers": 0,
"totalCustomers": 0,
"customerGrowth": [
{
"newCustomers": 0,
"period": "string",
"totalCustomers": 0
}
]
}
}
}
customerAnalytics(
period: AnalyticsPeriod!
): CustomerAnalytics!

Arguments​

customerAnalytics.period ● AnalyticsPeriod! non-null enum​

The reporting period to analyse.

Type​

CustomerAnalytics object​

Customer figures for the period.