Build a hybrid pricing and billing system like Segment, the Customer Data Platform leader, based on subscription plans, with a usage-based component that makes your revenue grow with your users.
What's in it for you?
In this article, you will learn how to build a pricing and billing system based on:
Subscription plans that gate specific features (e.g. only paying customers can access the API) and include a base consumption; and
Usage (e.g. number of monthly tracked users).
This template is suitable for companies with a product-led growth, such as CRMs, reverse ETLs, no-code data tools (e.g. Zapier) and customer data platforms.
What's the secret sauce?
Segment offers three pricing plans, called ‘Free’, ‘Team’ and ‘Business’. As the latter has a custom pricing, we will focus on the first two plans.
Base consumption (included)
Consumption (10k-25k MTUs)
Consumption (25k-100k MTUs)
Consumption (100k+ MTUs)
The usage-based component in Segment’s pricing is related to monthly tracked users (MTUs), namely the number of unique users whose data is stored on the platform each month.
As these are unique users, we must ensure that each user is counted only once during the billing process.
Now let’s see how we can implement Segment’s pricing plans using Lago.
What do you need?
The first thing to do is to create your company account on Lago Cloud or deploy Lago Open Source on your existing infrastructure. In both cases, you should ask a back-end developer to help you with the setup.
Our documentation includes a step-by-step guide on how to get started with our solution.
Step 1 – The ‘Free’ plan
Through Lago’s user interface, you can create a free pricing plan in just a few clicks.
All you have to do is choose a name, assign it a code, define the billing period and enter the amount (i.e. $0 in this case). Easy, right?
Step 2 – Identification of unique users
Now that we have our ‘Free’ plan, we can configure our ‘Team’ plan, which includes 10,000 MTUs.
Beyond that limit, Segment has implemented a graduated pricing model, based on the number of MTUs (i.e. $0.012 per unit between 10,001 and 25,000 MTUs, $0.011 per unit between 25,001 and 100,000 MTUs and $0.010 per unit beyond 100,000 MTUs).
Therefore, we need to calculate the number of unique users in order to implement our second pricing plan.
To do so, we are going to use a billable metric, which will allow us to aggregate incoming events on the platform to measure consumption.
We have created a billable metric, called ‘Tracked activity’, which includes the ‘tracked_user_id’ property. In addition to this, we have defined ‘count unique’ as the aggregation type.
We also define the aggregation type to be recurring in order to keep the aggregated amount for the next billing period.
What does this mean? Every time the customer data platform (e.g. Segment) records a new activity, a ‘tracked_activity’ event will be sent to Lago, which will then use the ‘tracked_user_id’ property to determine the number of unique users.
Step 3 – The ‘Team’ plan
It’s time to create our ‘Team’ plan. The subscription part is similar to the ‘Free plan’ (except that the amount is now $120). We can also add the 14-day free trial currently offered by Segment.
To charge customers for consumption (i.e. based on MTUs), we need to add a charge to our plan.
Using the ‘Tracked activity’ billable metric created previously, we have implemented the graduated pricing model to reproduce Segment’s pricing, including 10,000 free units (i.e. 10,000 unique users).
Following this example, for a customer on the ‘Team’ plan with 30,000 MTUs, at the end of the month, their invoice will amount to: