Start creating behavioral data faster with Snowplow BDP Cloud.
Try Free


​Customer lifetime value

Acquiring a new customer is between 5x and 25x more expensive than retaining an existing customer (CleverTap). By understanding customer lifetime value, teams can target their efforts and increase revenue.

About this article

Section 1 is a broad overview of the benefits and challenges of a warehouse-first approach to customer lifetime value

Section 2 is a technical guide to calculating customer lifetime value

Section 1

What is customer lifetime value?

The idea behind customer lifetime value is simple: it is the total amount of value derived by a business from a customer over the customer’s complete lifetime engaging with the business / product / company.

Calculating and maximizing a customer’s lifetime value contrasts with other approaches to increasing value e.g.:

  1. Optimizing basket size: where we optimize a specific “shopping visit”, rather than all the shopping visits performed by the customer. Amazon Prime is a great example of an initiative that reduces basket size (by encouraging members to place single item orders) but grows customer value nevertheless (by driving increased number of purchases by customer).
  2. Optimizing occupancy: where we optimize the revenue / profit per room or per seat rather than per customer.
  3. Optimizing sell-through rates: where we optimize either the fraction of something that is sold (where we do not control the total volume available e.g. ad inventory), or the volume produced to maximize profit (e.g. physical CDs: the more we cut the more we can sell, but the more are likely to remain unsold and therefore a net cost to the business)

Why is customer lifetime value important?

Maximizing customer lifetime value is generally the most sustainable way to drive value growth for any consumer-facing business, because:

  1. A minority of customers often account for the majority of profit. The best customers might be brand loyal, not “shop around”, rich or have other features that mean they behave differently from the majority of customers.
  2. Cost of acquisition is trending upwards. As a result, it is often more cost effective to spend money retaining existing customer rather than acquiring new customers. In addition, when acquiring new customers, the amount that should be spent varies widely depending on the type of customer acquired.
  3. It forces the business to take a long term approach to value creation rather than e.g. short term promotions that maximize revenue on a particular shopping trip, or particular product line, at the expense of eroding brand value.
  4. It emphasizes customer loyalty, which has repeatedly been shown to be an intangible asset that successful companies can monetize over long periods of time.
  5. It points to bigger opportunities for value creation (e.g. moving into new markets / complimentary services) rather than smaller opportunities (e.g. produce less of this particular CD because we do not think it will sell well in this market). In general, that is because the upper limit to the value you can generate from each customer will be much higher than the upper limit for a basket of goods or bed in a hotel, for example.

Maximizing customer lifetime value is only possible if you can measure it (and therefore track improvements over time). So measuring customer lifetime value is critical to driving long term growth for consumer-facing businesses.

Where is customer lifetime value used?

Customer lifetime value is used to support a range of business functions. Two, however, stand out in particular:

  1. Driving your acquisition strategy. Tailor spend per channel based on the expected customer lifetime value of customers acquired from those channels.
  2. Improving your customer relationship management (i.e. grow loyalty, reduce churn). Personalise marketing, communication and promotions to the existing customer base to maximize their loyalty and customer value. (For example, tailor spend to cultivate loyalty in the most valuable customers.)

The limitations of traditional web analytics tools when calculating customer lifetime value

Traditionally, web analytics tools have sucked at enabling analysts to calculate customer lifetime value:

  1. They don’t make it easy to capture value outside of transaction-based businesses, e.g. ecommerce
  2. They don’t make it easy (or often possible) to slice all historical data by customer. (Because they typically only expose session-level data.)
  3. They don’t integrate with other systems used in other channels, to enable a holistic view of customer behavior and value across online and offline channels
  4. They don’t provide the granular data required to build sophisticated models to forecast customer value going forwards

Fortunately, Snowplow addresses the above limitations, enabling analysts to calculate customer lifetime value as detailed below.

Section 2

How to calculate customer lifetime value with Snowplow

There are different levels of sophistication to calculate customer lifetime value. The diagram below illustrates some different approaches:

We can distinguish different levels of sophistication when measuring customer lifetime value:

The simplest approach to calculating CLV

When starting out, companies can choose to define customer lifetime value as the total revenue earned from this customer to date. This provides a past-facing metric on which to base decisions related to that customer or group of customers.

A more sophisticated approach to CLV

Once a basic – past facing – understanding of CLV is achieved, teams can start to estimate the total lifetime value of the customer (past and future) based on the customer’s historical data. AI and ML can be particularly beneficial when identifying patterns here, although BI approaches are also possible.

For example, a mobile telco business may assume an average length of contract for each customer, and project the expected revenue earned from each customer based on their predicted contract length. This figure could then be included as part of the total Customer Lifetime Value.

Additional advanced strategies

  1. We can be even more sophisticated about how we model future revenue, for example, by using different figures for different customers based on what customer segment they belong to.

2. Further to projecting revenues going forwards, we might want to discount future revenue to net present value in our calculation.

3. Instead of measuring the revenue earned for each customer, we might want to look at profit. This prevents a business focusing unnecessarily on high revenue but unprofitable customer segments.

4. Instead of looking at the revenue / profit directly attributable to each customer, we might want to value the other activities that a customer engages with that create value but do not directly result in revenue. This is important for social networks / community sites where users contribute content, for example.

5. Which approach you adopt will depend on your own circumstances, data quality and customer understanding: a cruder approach will often suffice and a more sophisticated approach may be misleading if there isn’t the customer understanding in place to justify the assumptions an analyst uses in predicting future revenue / profits per customer.

In all cases, Snowplow provides a solid foundation for doing the customer-lifetime value calculations. 

Specific Customer Lifetime Value use cases with Snowplow

1. Summing historical revenue by customer over time

Snowplow makes it easy to sum the amount of direct revenue attributable to each customer over their entire user history. You can follow along with this mini-tutorial using Try Snowplow

Let’s start with the example of an online retailer, that has implemented Snowplow so that every time an order is completed, a transaction event is fired where:

  • event = ‘transaction’
  • tr_orderid = {ORDER ID}
  • tr_total = {ORDER TOTAL VALUE}

This would produce an atomic events table with the following rows. We’ve just included the relevant columns here for simplicity

  • event_name is filtered here to only show transaction events
  • derived_tstamp is calculated by snowplow to be the most likely time the transaction happened
  • domain_userid is the snowplow cookie that is deployed to all clients by the tracker
  • tr_orderid is the order id of the transaction
  • tr_total is the total value of the transaction

Then to calculate the total revenue by customer over time, we’d simply execute the following query:

/* PostgreSQL / Redshift */




FROM "atomic".events

WHERE event = 'transaction'


If there are several different types of events where revenue is directly attributable (e.g. customer submits a lead form as well as buys a product), we can track those events, and add them to our query.

2. Including all revenue per customer across multiple channels

Many businesses monetize customers on multiple channels, not just web. To sum revenues across all those channels, you will need to join your web analytics data with your offline sales data on a per-customer basis. Details of how to do this is documented here.

3. Including indirect value as well as direct revenue / profit

For many online businesses, customers engage in multiple value-generating activities that only generates revenue indirectly. To give some examples:

  1. Inviting a friend to use a service. (E.g. on a social network, community site or group buying site.)
  2. Writing user-generated content e.g. a review
  3. Viewing a web page. (If there is ad content on the page.)
  4. Signing up for email marketing
  5. Signing up to a new freemium service

How you ascribe value to actions like the ones listed above will be subject to a blog post in the future. (There are wide range of possible techniques: because Snowplow gives you access to granular event-level detail, it enables you to use a wide range of techniques to analyse the associated value.) The important thing to understand from the perspective of this guide is that there is a value that you ascribe at the time you perform the analysis. When you perform the anaysis, you create a table with the different values:

CREATE SCHEMA clv_calculation;

CREATE TABLE clv_calculation.events_by_value (

se_action VARCHAR(10),

value FLOAT);

Populate the above table with each different type of event and the value you want to ascribe it e.g.

INSERT INTO clv_calculation.events_by_value VALUES

('social', 2.5), ('email', 2.5);

You can then add up the value of actions that indirectly drive revenue by joining the above table with the Snowplow events table:




FROM "atomic".events e

JOIN clv_calculation.events_by_value v

ON e.se_action = v.se_action


You would then sum the indirect value by domain_userid generated by the above query with the direct revenue attributable to each user calculated in the previous section

4. Include expected future value

Like ascribing value to actions that only indirectly generate revenue, documenting all the different approaches to estimating future value from each customer is beyond the scope of this guide, it’s something we will cover in a blog post in due course.

Here, we assume that you have a process of segmenting your customers, and have a future value you assign to customers in each of those segments. In this circumstance, you will need to create a two tables in Snowplow – the first records each segment and the future value ascribed to people in each segment:

CREATE TABLE clv_calculation.future_value_by_segment (

segment VARCHAR(10),

value FLOAT )

And another table that maps user identifiers (e.g. domain_userid) to each segment:

CREATE TABLE clv_calculation.user_ids_by_segment (

segment VARCHAR(10),

domain_userid VARCHAR(16)


You would populate the above 2 tables and then execute a query like the following, to calculate estimated future value for each customer:



SUM(value) AS future_value

FROM future_value_by_segment f

JOIN user_ids_by_segment u

ON f.segment = u.segment


The resulting future_value by user_id would be added to the past value calculated for each user (including both direct revenue and indirect value, as desired) to derive an overall figure for customer lifetime value for each user_id.

To test this for yourself, try Snowplow for free