Prompt
How do I do next-best-offer ranking in a SaaS app?
Latest observation
Next-best-offer (NBO) ranking in a SaaS app usually means: given a user/account and the current context, choose the best action or offer to show next—upgrade prompt, feature recommendation, discount, onboarding step, add-on, renewal save offer, etc.
A good implementation is usually a mix of rules + machine learning + experimentation.
1) Define the decision clearly
Start by specifying:
- What are the candidate offers?
Examples: upgrade plan, trial extension, add seat, invite teammate, enable integration, book demo. - What is the objective?
Examples: conversion, retention, expansion revenue, activation, reduced churn. - What is the constraint?
Example: don’t show more than 1 offer/day, exclude offers already seen, avoid discounting premium accounts.
In SaaS, NBO is often not “highest click probability,” but:
- expected revenue
- expected retention lift
- expected activation lift
- or a weighted blend of these
2) Build the candidate generation layer
Don’t rank every possible offer from scratch. First generate a small eligible set.
Typical filters:
- user segment: role, industry, plan tier
- product usage: features used/not used, frequency
- lifecycle stage: new user, active, dormant, churn-risk
- eligibility rules: account size, region, contract type
- suppression rules: already purchased, recently shown, legal restrictions
Example:
- If user is on Free and uses collaboration heavily, candidate offers might be:
- upgrade to Pro
- invite teammate
- enable shared workspace
3) Choose a scoring approach
There are a few common options.
A. Rule-based ranking
Simple starting point:
- assign score by business priority
- use if you have limited data
Example:
- churn-risk save offer: 90
- upgrade CTA: 70
- feature education: 40
Good for:
- cold start
- low traffic
- strict business control
B. Propensity models
Train a model to predict:
- probability of click
- probability of conversion
- probability of retention
- expected spend
Then rank by something like:
expected value = P(action) × value(action) − cost(action)
Example:
- upgrade offer expected value = P(upgrade) × incremental MRR
- discount offer expected value = P(convert) × margin impact
C. Contextual bandits
Great for NBO because they balance:
- exploitation: show what seems best
- exploration: try alternatives to learn
This is useful when:
- you have many offer types
- user preferences vary a lot
- the environment changes frequently
D. Full recommendation models
If you have lots of data, you can use:
- learning-to-rank
- two-tower retrieval + ranking
- gradient boosted trees / deep models
But for many SaaS teams, propensity model + business rules + experimentation is the sweet spot.
4) Define features
Common features for SaaS NBO:
User/account features
- plan type
- seat count
- ARR / MRR
- company size
- industry
- region
- lifecycle stage
- tenure
Behavioral features
- logins last 7/30 days
- feature adoption
- usage frequency
- recent actions
- abandoned flows
- support tickets
- NPS or health score
Offer features
- offer type
- discount amount
- product area
- expected value
- complexity
- urgency
Context features
- channel: in-app, email, sales call, popup
- device
- time since last prompt
- page/location in app
- campaign/source
5) Decide the ranking formula
A practical formula is:
score(offer, user, context) = uplift × business_value × eligibility_weight − friction
Where:
- uplift = predicted probability improvement from showing the offer
- business_value = revenue, retention, or activation value
- friction = annoyance, support burden, discount cost, or overload
If you only have conversion prediction:
score = P(convert | user, offer, context) × value_of_conversion − cost_of_offer
6) Add constraints and guardrails
This is very important in SaaS.
Examples:
- Don’t show upgrade offers to users who just paid.
- Cap frequency: max 2 offers/week.
- Suppress if user is in a support incident.
- Avoid conflicting offers.
- Respect customer success / sales ownership.
- Exclude enterprise accounts from self-serve discounting.
- Don’t upsell before activation basics are complete.
Guardrails prevent the system from optimizing the wrong thing.
7) Measure with experiments
You need A/B testing or multi-armed bandits to validate. Track:
- CTR
- conversion rate
- incremental revenue
- retention/churn
- activation milestones
- complaint rate / hide rate / unsubscribe rate
The key metric should be incremental lift, not just click-through.
8) Recommended architecture
A simple production architecture:
- Event pipeline collects product usage events
- Feature store aggregates account/user metrics
- Eligibility service filters allowed offers
- Ranking service scores candidates
- Decision engine applies rules, constraints, exploration
- Experiment layer assigns variants
- Logging records impressions, clicks, conversions, and outcome labels
9) Practical MVP path
If you’re starting from scratch:
Phase 1: Rules
- define segments
- define eligible offers
- hand-rank by business rules
Phase 2: Propensity model
- predict conversion for each offer
- rank by expected value
- add frequency caps
Phase 3: Bandits / uplift
- explore alternatives
- optimize incremental impact, not raw response
Phase 4: Personalization at scale
- separate models by lifecycle stage or offer family
- automate candidate generation
- optimize across channels
10) Common mistakes
- optimizing clicks instead of revenue or retention
- ignoring suppression/frequency rules
- showing offers without eligibility filtering
- training on biased impression data without counterfactual thinking
- not separating “who gets shown” from “what they see”
- using one model for all offer types when behaviors differ
11) Example
Suppose you have these offers:
- Upgrade to Pro
- Invite teammate
- Connect Slack
- Book onboarding call
For a user on Free plan with heavy team usage:
- Upgrade to Pro: high revenue value
- Invite teammate: high activation value
- Connect Slack: moderate engagement value
- Book onboarding call: high for new accounts only
Your ranker might compute:
- Upgrade: 0.22 × $120 = $26.40
- Invite teammate: 0.35 × $30 = $10.50
- Slack: 0.40 × $15 = $6.00
- Onboarding call: not eligible
So the system shows “Upgrade to Pro” first, unless rules say “invite teammate” is preferred during onboarding.
If you want, I can also give you:
- a concrete ML design for NBO ranking,
- a SQL/schema + event tracking plan, or
- a Python/pseudocode example for scoring and ranking offers.