Detecting when customers defect and go elsewhere can be more of an art than a science.
For most Shopify stores, there isn't a cancellation that marks when a customer defects. They just stop showing up.
That's why most defect detection relies on measuring how long it's been since their last order. If it's longer than a specific value, they are confident the customer defected.
That value will be different for each store and will change all the time. A store selling swimwear might only see a customer once a year during their spring/summer season. Even then, customers might not order every year and a defection might take years before showing up. A store selling dog food on the other hand, might see a customer every month or two and consider them defected if more than three months pass without an order.
With such a wide range of reorder times between stores it's important to calculate your own reordering times. This is called the Average Customer Purchase Latency or Average Latency for short.
(Latency is the time interval in-between events. Customer Purchase Latency is then the time interval in-between customer purchases, usually listed as a number of days)
Calculating the Average Latency is simple but data-intensive. You need to calculate the Customer Purchase Latency for each customer first and then average it into a single store value.
Once you know when customers should order for your store (on average), then you can apply it to figure out who might be defecting. You'll want to add some padding of 25-50% to get a better view (e.g. handle slow ordering customers who haven't actually defected).
Average Latency is a wonderful metrics that can be used beyond defections.
Since it shows when customers should be reordering, you can start to predict reorders and nudge customers to order again. Repeat Customer Insights uses a form of this prediction for getting new customers to place their second order.