← Blog

·

RFM segmentation on WhatsApp: send the right message to each customer

Updated on November 24, 2026

RFM segmentation on WhatsApp means grouping customers by three numbers from their purchase history: how many days since their last order (recency), how many orders they placed (frequency) and how much they spent (monetary value). With a 1–5 score on each axis, you can separate champions, at-risk customers and new customers, and send each group a different template instead of blasting the same offer to everyone. That lowers the cost per campaign and the risk of blocks.

Below: the calculation in a spreadsheet or in Python, the segments, the message and template category for each, and the cost math.

Why segment before sending on WhatsApp

Every delivered WhatsApp marketing message has a price. For recipients in Brazil, Meta’s marketing rate has been BRL 0.3217 per message (Brazilian reais) since October 1, 2026, and only delivered messages are charged (Meta pricing). Sending an offer to someone who hasn’t bought in two years costs the same as sending it to your best customer.

Delivery matters too. Meta may limit how many marketing templates each person receives in a period, and a message blocked by that limit comes back with error 131049 (per-user limits). Negative user feedback, such as blocks and reports, affects your number’s quality. A message the recipient actually cares about is the simplest way to protect both.

RFM uses data every store already has: orders with customer, date and amount.

The three axes: recency, frequency and monetary value

AxisQuestionHow to measureHigh score means
Recency (R)How long since they bought?Days since last orderBought recently
Frequency (F)How often do they buy?Number of orders in the periodBuys regularly
Monetary (M)How much did they spend?Sum of orders in the periodSpends more

Pick a period that matches your purchase cycle (12 months for retail; 6 months for fast-moving goods such as pharmacy or pet supplies) and count paid orders only.

The 1–5 score comes from quintiles: sort customers on each axis and split them into five groups of similar size. Recency works the other way around: fewer days since the last order means a higher score.

Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →

How to calculate RFM in a spreadsheet

Build a sheet with one row per customer (export from your e-commerce platform, ERP or CRM and group orders by customer):

ColumnContent
AName
BWhatsApp number with country code (e.g. 5511999999999)
CDate of last order
DNumber of orders in the period
ETotal spent in the period
FDays since last order
G, H, IR, F and M scores
JSegment

Assuming data in rows 2 to 1000, these formulas work in Excel and Google Sheets with English locale settings. In other locales, function names may be translated and commas may become semicolons.

CellFormula
F2=TODAY()-C2
G2 (R)=6-MIN(5,1+INT(PERCENTRANK.INC($F$2:$F$1000,F2)*5))
H2 (F)=MIN(5,1+INT(PERCENTRANK.INC($D$2:$D$1000,D2)*5))
I2 (M)=MIN(5,1+INT(PERCENTRANK.INC($E$2:$E$1000,E2)*5))

Copy the row 2 formulas down to the other rows.

PERCENTRANK.INC returns the customer’s position between 0 and 1; times 5, plus 1, becomes a 1–5 score, and MIN prevents a score of 6. In column G, the 6- flips the score, because fewer days is better for recency.

Watch out for frequency: if most customers bought only once, ties push many people into the same score. In that case, swap quintiles for fixed bands that make sense for you (1 order = 1, 2 orders = 2, 3–4 = 3, 5–7 = 4, 8 or more = 5).

The same calculation in Python

If your base is large or already lives in a database, pandas can compute it straight from the order list:

import pandas as pd

orders = pd.read_csv("orders.csv", parse_dates=["date"])  # columns: wa_id, date, amount
today = pd.Timestamp("2026-11-24")

rfm = orders.groupby("wa_id").agg(
    recency=("date", lambda d: (today - d.max()).days),
    frequency=("date", "count"),
    monetary=("amount", "sum"),
)

rfm["R"] = pd.qcut(rfm["recency"].rank(method="first"), 5, labels=[5, 4, 3, 2, 1]).astype(int)
rfm["F"] = pd.qcut(rfm["frequency"].rank(method="first"), 5, labels=[1, 2, 3, 4, 5]).astype(int)
rfm["M"] = pd.qcut(rfm["monetary"].rank(method="first"), 5, labels=[1, 2, 3, 4, 5]).astype(int)


def segment(row):
    r, f = row["R"], row["F"]
    if r >= 4 and row["frequency"] == 1:
        return "new"
    if r >= 4 and f >= 4:
        return "champions"
    if r >= 3 and f >= 3:
        return "loyal"
    if r >= 4:
        return "promising"
    if f >= 3:
        return "at_risk"
    return "hibernating"


rfm["segment"] = rfm.apply(segment, axis=1)
rfm.to_csv("rfm.csv")
print(rfm["segment"].value_counts())

rank(method="first") breaks ties so qcut can build five groups. You need at least five customers.

Segments and messages: what to send each group

The segment rules above are a starting point; tune the cut-offs to your business. For each segment, a message idea and the likely template category:

SegmentRule (R, F)GoalMessage ideaLikely category
ChampionsR 4–5, F 4–5Retain and rewardEarly access to a launch or collectionMarketing
LoyalR ≥ 3, F ≥ 3Increase frequencyPoints program or cashbackMarketing
NewR 4–5, 1 orderDrive the second purchaseHow to use what they bought; later, a complementary productUtility (order only) or marketing (with a recommendation)
PromisingR 4–5, F 1–2Build a habitProduct that complements the last orderMarketing
At riskR 1–2, F ≥ 3Win back before they churn“We miss you” with a perkMarketing
HibernatingR 1–2, F 1–2Last attempt or pauseOne message, or noneMarketing

Meta decides the category based on the template’s content. The categorization docs say that recommending products and offers is marketing even when the user asked for it, and that a template mixing an order update with a promotion is marketing. So a welcome message to new customers only has a chance at utility if it talks about the order alone.

Two segments deserve special attention:

  • At risk customers used to buy often and went quiet. They are the group with the most to lose. The guide on winning back inactive customers on WhatsApp covers the win-back sequence, and the messages for customers who disappeared give you ready-made copy.
  • Hibernating is usually the largest group and the least responsive. A weekly offer burns balance and triggers reports; one attempt per quarter, or none, is more sensible.

For products with a predictable consumption cycle, combine RFM with the expected next purchase date: see the WhatsApp reorder reminder.

Campaigns per segment: building the calendar

  1. Recalculate RFM every month. March’s champion may be at risk by September.
  2. One template per segment. Create and get templates approved ahead of time. Use variables for name and last product, and add an opt-out button such as “Stop offers”.
  3. Frequency cap per segment. For example: champions and loyal up to one marketing message per week; promising every two weeks; at risk a short sequence; hibernating once per quarter. These numbers are your business decision, not Meta’s. See WhatsApp broadcast frequency.
  4. Control group. Hold out part of each segment from the campaign. The difference in purchases between those who got it and those who didn’t shows the real effect.
  5. Measure per segment. Delivered, read, clicks and purchases. An expensive segment with no return leaves the calendar.

Opt-in, limits and errors you will see

Segmentation does not replace consent. Meta requires opt-in before a business starts a conversation: the person must have given their number and agreed to receive messages from your business (getting opt-in). A customer who bought in your store has not opted in automatically. Match your RFM sheet against your opt-in list and only send to people who agreed.

In the status webhook, two errors change your base:

CodeWhat it meansWhat to do
131049Not delivered due to the per-user marketing limitDon’t resend for at least 24 hours; lower the frequency for that contact
131050The customer stopped receiving marketing messages from your businessMark as opted out and remove from all campaigns

The article on the per-user marketing limit explains 131049 in detail. One point in favor of segmentation: when a customer replies to a marketing message, a 24-hour customer service window opens, and according to Meta, marketing messages sent inside it don’t count toward that limit.

Purchase data used in RFM is personal data. In Brazil it falls under the LGPD (Lei 13.709/2018, the Brazilian General Data Protection Law). Define your legal basis, state in the opt-in that you use purchase history to personalize offers, and honor deletion requests. This is not legal advice; check with a lawyer.

Cost: whole base vs. segments

Hypothetical example: a store with 10,000 contacts opted in to marketing, recipients in Brazil, BRL 0.3217 per delivered message:

StrategyDelivered messagesMeta cost
Same offer to the whole base10,000BRL 3,217.00
Champions, loyal and at risk only (assuming 3,500 contacts)3,500BRL 1,125.95
Hibernating, once per quarter (assuming 4,000 contacts)4,000BRL 1,286.80 per send

Segment sizes are assumptions for the math; yours come from the spreadsheet. A welcome message to new customers, if approved as utility, costs BRL 0.0350. The full reasoning, with delivery rate and return, is in how much a WhatsApp campaign costs. To simulate other volumes, use the WhatsApp API pricing calculator.

How to do it with Vectalk

Vectalk is a proxy for the official WhatsApp API: you pay Vectalk and Vectalk pays Meta. The dashboard has no native segmentation or bulk sending: RFM runs in your spreadsheet, CRM or database, and your system (or n8n, Make) calls the API for each contact in the segment.

Templates for each segment are created in the dashboard, in the templates area with the Template Library. Sending goes to POST https://apis.vectalk.com.br/api/messages with the Cloud API payload (template reference):

{
  "messaging_product": "whatsapp",
  "to": "5511999999999",
  "type": "template",
  "template": {
    "name": "we_miss_you",
    "language": { "code": "en" },
    "components": [
      { "type": "body", "parameters": [{ "type": "text", "text": "Mariana" }] }
    ]
  }
}

If your base lives in Google Sheets, the guide to sending WhatsApp messages from Google Sheets shows how to connect the sheet to the API. Webhooks are Meta’s, so errors 131049 and 131050 arrive in the format of the official docs. Each delivered message is deducted from your prepaid balance, and you don’t add a card on Meta. Create your account to get started.

Frequently asked questions

How often should I recalculate segments?

Once a month is a good default. Fast-moving businesses can recalculate weekly. What matters is using the current score when you build each campaign.

Can a message to a loyal customer be a utility template?

Only if it isn’t promotional and relates to something specific to the customer, such as an order. Offers, product recommendations or invitations to buy again are marketing under Meta’s categorization rules, and Meta decides the category at approval.

Can I message champions who never opted in?

No. Meta requires opt-in before any business-initiated contact, regardless of purchase history. Ask for consent at checkout or after the sale.


Official sources consulted on November 24, 2026: Cloud API pricing (Meta), Per-user marketing limits (Meta), Marketing templates (Meta), Template categorization (Meta), Getting opt-in (Meta), Lei 13.709/2018 (LGPD), Vectalk: send template.

Put your business on the official WhatsApp

Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.