Big Problems of Companies: Customer Segmentation
Many companies need to segment their customers in order to make predictions for the future, develop different marketing strategies or realized customer-specific campaings. The questions are similar for almost every company; Who are our best customers? Which customer group should we focus on? For which group do we not need to texpend energy? Do we need to take action to get new customers? Which of our customers could contribute to our churn rate? etc.
RFM is a data-driven customer segmentation technique that allows marketers to take tactical decisions. It empowers marketers to quickly identify and segment users into homogeneous groups and target them with differentiated and personalized marketing strategies. This in turn improves user engagement and retention.
Well, what are these RFM metrics? Let’s see together.
Underlying the RFM segmentation technique is the idea that marketers can gain an extensive understanding of their customers by analyzing three quantifiable factors:
- Recency: the date of customer’s last purchases or visits (e.g. time since last order or stay engaged with product)
- Frequency: frequency of the customers transactions or visits (e.g. total number of transactions or average time between transactions/engaged visits)
- Monetary: purchasing power of customer (e.g. total or average transactions value)
Let’s do a customer segmentation example with RFM, step by step
An e-commerce company segments its customers and wants to determine marketing strategies according to segments. If marketing efforts are made according to customer segments that exhibit common behavior, the company is expected to experience revenue growth. For instance, for retaining customers that are very profitable for the company different campaigns can be made.
The dataset include the sales of a UK-based e-commerce company between 12/01/2009–12/09/2011.
Variables in the dataset: InvoiceNo (If this code starts with C, it means that the operation has been cancelled), StockCode (Product code), Description, Quantity, InvoiceDate UnitPrice (Invioce price), CustomerID and Country
After installing the library and reading the data set, we make the necessary pre-processes. Dataframe looks like this:
Firstly we need to calculate the frequency, recency and monetary values.
- We save the monetary value as “TotalPrice” and find it price * quantity.
- For frequency, we choose unique invoices.
- For the recency value; we subtract the date of the last purchase from today’s date. (We calculated in days)
After the calculations, we group them with these values according to the Customer ID, and we saved as rfm. For become clear, we’re changing the column names by recency, frequency, and monetary.
In this case the dataframe will look like this:
In this step, we need to convert these calculated values into scores. Let’s choose values from 1 to 5 for scoring and name the labels as A, B, C, D. We use the qcut method for this process. This method sort the values as ascending.
Note: I made the segments for receny and frequency values only, monetary is not included.
We convert scores into segment names that we define in a dictionary. We use regex here because it is an example of rule based segmentation.
Finally, we can analyze for related variables by grouping according to segments.
The final output is:
These segments are on the graph as follows:
Now, let’s discuss how to interpret the RFM segments to understand the behaviors of those users, and recommend some effective marketing strategies.
Looking at the analysis results;
*Champions are our best customers, who bought most recently, most often, and are heavy spenders. They can become early adopters for new products and will help promote our brand.
*According to the recency and monetary values, there is a can’t loese segment in the second place, but they haven’t been visiting recently. We need to bring them back with relevant promotions, and we can run surveys to find out what went wrong and avoid losing them to a competitor.
*The next segment with the highest mean value is loyal customers. These customers are active and loyal, but they are low spenders. We should create campaigns for this group that make them feel valued, and incentivize them to increase their spend levels. As loyal customers, we can also pay to reward them with special offers if they spread the word about the brand to their friends, e.g., via social networks.
*Finally, let’s comment on new customers with high recency value but low monetary and frequency values. We can start building relationships with these customers by providing onboarding support and special offers to increase their visits.
However, one of the important points to be decided here is; cost account! This segment may not be targeted if acquiring new customers is more costly than retaining an existing customer.
I hope this article was helpful, see you next time :)