How to Calculate Customer Lifetime Value for a Shopify Store
Four ways to calculate customer lifetime value on Shopify: historic, cohort-based, predicted and margin-based, with a worked example and LTV to CAC.
Customer lifetime value is the sales, or better the margin, that an average customer brings you over a stated period. The simplest version divides the net sales from a group of customers by the number of customers in that group. This guide walks through four versions of the calculation, from historic to predicted, shows one worked example, and explains how to use the result next to acquisition cost.
What is the basic formula for lifetime value?
Historic LTV equals net sales from a group of customers divided by the number of customers in the group, over a fixed window.
Two choices make the number meaningful:
- The group. All customers ever is the weakest choice, because it mixes people who joined five years ago with people who joined last week. A group defined by when they first ordered is far more useful.
- The window. A 'lifetime' with no end date cannot be measured. State it: 90-day LTV, 12-month LTV, 24-month LTV. The window should be long enough to include a typical reorder and short enough that you can act on it.
You will also see LTV written as average order value multiplied by the number of orders per customer. It is the same sum arranged differently, and it is handy for seeing whether value comes from larger orders or more of them. Use net sales, so that discounts and returns are already taken off; our guide to gross, net and total sales explains the difference.
How do you calculate LTV by cohort?
Group customers by the month of their first order and follow each group forward. This is the version to rely on, because every customer in the group has had the same amount of time to come back.
- Export orders with customer ID, order date and net sales.
- For each customer, find the date of their first order and assign them to that month's cohort.
- For each cohort, add up net sales in the first 30 days, the first 90 days, the first 12 months, and so on.
- Divide each total by the number of customers in the cohort.
Here is a worked example with made-up round figures. Say 1,000 customers placed their first order in January of last year. Over the following 12 months, those 1,000 people placed 1,600 orders in total, including their first, worth $96,000 in net sales.
- 12-month LTV: $96,000 divided by 1,000 customers, or $96.
- Orders per customer: 1.6.
- Average order value: $96,000 divided by 1,600, or $60. And $60 multiplied by 1.6 gives $96 again.
Run the same sum for the February cohort, the March cohort and the rest, and compare them at the same age. A cohort acquired during a deep sale may show a lower 12-month figure than one acquired at full price, and that difference is the whole point of the exercise. For help with the table this produces, see how to read a cohort analysis.
Why should LTV be based on margin?
Because you pay for acquisition out of margin, not out of revenue. A customer worth $96 in sales has not given you $96 to spend.
Margin-based LTV multiplies the sales figure by your gross margin, or better, subtracts the real costs order by order: cost of goods, shipping you paid and payment fees.
Continuing the example: if the store's margin after those costs is 50% of net sales, the January cohort's 12-month margin LTV is $48 per customer. That is the figure to hold against what it cost to win the customer.
What is predicted lifetime value?
It is an estimate of what a customer will be worth in future, extended from the behaviour of earlier customers. Historic LTV tells you what happened; predicted LTV guesses what will.
If older cohorts earned a certain amount in their second year relative to their first, a newer cohort that looks similar in its first months may follow the same curve. Every such model assumes the future resembles the past.
That assumption breaks in ordinary ways: you change prices, a product is discontinued, a new channel brings a different kind of buyer. So treat any predicted figure as an estimate with a range around it, check it against cohorts as they mature, and avoid planning spend on predictions that reach further ahead than your oldest reliable data.
How do you use LTV with CAC?
Compare margin-based LTV over a stated window with the cost of acquiring a new customer in the same period. If margin LTV is higher than CAC, a customer pays back within that window. If it is lower, you are relying on purchases that have not happened yet.
In the example, a 12-month margin LTV of $48 against a customer acquisition cost of $30 means each new customer returns the spend and leaves $18 within a year.
Two cautions:
- Match like with like. Use new-customer CAC, not spend divided by all orders, and LTV from the cohorts that spend acquired. Our guide to ROAS, CAC and MER covers the cost side.
- Mind the cash. A ratio that works over 24 months still means funding stock and ads for two years before the customer has paid you back. The payback period, the month in which cumulative margin passes CAC, is often more useful than the ratio.
Where do the numbers come from?
Orders and customers come from Shopify, product costs from the cost field on each product, and ad spend from the ad platforms.
Marka Metrics builds retention cohorts and predicted lifetime value from your Shopify orders on its Growth and Pro plans, along with net profit that takes in product costs, fees and ad spend. For background on what Shopify's own reports cover, see the guide to built-in Shopify analytics and their gaps.
A short checklist
- Always state the window: 90-day, 12-month or 24-month LTV.
- Group customers by first-order month, not all together.
- Use net sales, then convert to margin.
- Compare cohorts at the same age.
- Label predicted LTV as an estimate and recheck it as cohorts mature.
- Set margin LTV against new-customer CAC and note the payback month.
Lifetime value is only as good as the cohort and the window behind it. To see cohorts, predicted lifetime value and profit from your own orders without rebuilding the spreadsheet each month, have a look at Marka Metrics.
Work with us
House of Marka is the applied-AI and commerce engineering studio of Marka Modern Retail Private Limited. We research, advise and then build — for merchants and enterprises in the US, UK and Europe.