get_customer_insights
Get customer behavior and retention insights. All reports are per-store in multi-store mode — use the store param to target a specific store. Reports: new_vs_returning (revenue/orders/AOV split by first-time vs repeat buyers), repeat_metrics (repeat purchase rate, avg days between purchases, BOTH avgLifetimeValue and medianLifetimeValue, lifetimeValueSkewRatio + distribution note — LEAD WITH MEDIAN when describing 'the typical customer', use mean only when distribution is symmetric; if lifetimeValueDistributionNote is present the mean is misleading), cohorts (monthly acquisition cohorts — counts and aggregate repeat rate), retention_curve (per-cohort cumulative retention % AND LTV at month 1/3/6/12 — the canonical e-commerce LTV view; cohorts that haven't matured to a milestone show null for that milestone, not a fake-low value), by_category (repeat rate by Shopify product_type — requires product_type to be set, returns 'Uncategorized' if not), cohorts_by_first_purchase (cohorts by first product category), top_customers (ranked by LTV or order count), lapsed_high_value (high-spending customers who haven't ordered recently — per-store, ideal for targeted win-back campaigns; rows carry a Shopify-admin adminUrl (this dataset holds no names/emails by design) and customer tags, trade-frequency accounts are flagged likelyWholesale so they're excluded from consumer win-backs, and customers inactive beyond maxDaysInactive (default 365d) are treated as churned and excluded).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | For top_customers and lapsed_high_value: number of results (default: 20) | |
| months | No | For cohorts and retention_curve: number of months to look back for acquisition (default: 6 for cohorts, 12 for retention_curve) | |
| report | Yes | Report type | |
| sortBy | No | For top_customers: sort by totalSpent or orders (default: totalSpent) | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| endDate | No | End date (YYYY-MM-DD) | |
| minSpent | No | For lapsed_high_value: minimum lifetime spend in major units, e.g. 500 for £500 (default: 500) | |
| startDate | No | Start date (YYYY-MM-DD) | |
| daysInactive | No | For lapsed_high_value: days since last order to count as lapsed (default: 90) | |
| maxDaysInactive | No | For lapsed_high_value: upper bound on inactivity — customers whose last order is older than this are treated as churned, not lapsed, and excluded (default: 365). Raise to see the long tail. |