Skip to main content

RFM — Reference

The RFM (Recency, Frequency, Monetary) model segments customers by transactional behaviour:

  • Recency — how long since the last transaction.
  • Frequency — how many transactions in the observed period.
  • Monetary — how much the customer has spent.

RFM is a descriptive model, commonly used for segmentation, churn analysis, and targeting.

Input data: see AI Model Data Requirements → RFM.


Key concepts

  • Transactions as events — each row of the event table represents a transaction (or equivalent business event).
  • Allowed statuses — optionally restrict to valid statuses (e.g. "Closed Won", "Completed").
  • Output — one row per user with R, F, and M scores plus a segment label, linked to bpp_user_id.

JSON configuration reference

FieldTypeDescriptionExample / best practice
data_src.regionSTRINGCloud region (auto-populated)."europe-west8"
data_src.project_idSTRINGGCP project ID (auto-populated)."audience-ai-dev"
data_src.event_table_idSTRINGEvent table with transactions (a *_bpp table)."deal_status_change_bpp"
data_src.column_priceSTRINGColumn with the monetary value per transaction."Deal_Amount"
data_src.column_statusSTRINGColumn with the transaction/deal status."Stage"
data_src.allowed_statusesARRAYStatus values considered valid transactions.["Closed (Won)"]
data_src.column_timestampSTRINGTransaction timestamp column (UTC)."event_date"
data_src.sample_intervalINTNumber of days in the analysis window.365

Example configuration

{
"data_src": {
"region": "europe-west8",
"project_id": "example-project",
"column_price": "Deal_Amount",
"column_status": "Stage",
"event_table_id": "deal_status_change_bpp",
"sample_interval": 365,
"allowed_statuses": ["Closed (Won)"],
"column_timestamp": "event_date"
}
}

Output structure

ColumnTypeDescription
bpp_user_idSTRINGUser identifier linked via identity resolution
recency_scoreINTRelative recency score (e.g. 1–5)
frequency_scoreINTRelative frequency score (e.g. 1–5)
monetary_scoreINTRelative monetary score (e.g. 1–5)
rfm_clusterSTRINGSegment label (e.g. Champions, At Risk, Hibernating)

Business rules by industry

E-commercecolumn_price = order value; allowed statuses "Completed", "Paid"; interval 180–365 days.

B2B / CRMcolumn_price = deal amount; allowed statuses "Closed (Won)"; extend the interval for long sales cycles (e.g. 730 days).

Subscription / SaaS — treat renewals as transactions; allowed statuses "Renewed"; recency helps flag churn risk.

Retail with seasonality — interval should cover at least one full seasonal cycle (e.g. 365 days); allowed statuses "Completed".


Best practices

  • Ensure timestamps are in UTC.
  • Include only transactions that reflect actual revenue (exclude cancelled/refunded).
  • Choose the sample interval by purchase cycle: fast-moving goods 90–180 days, durable goods 365–730 days.
  • Use segments to prioritise actions: Champions → loyalty; At Risk → win-back; Hibernating → awareness.