Referral Program Guide · Bubble.io

How to Build a SaaS Referral Program in Bubble.io

Referral programs are the cheapest acquisition channel in SaaS. Customers who sign up through referrals convert better, churn less, and spend more. This guide covers the complete data model, referral tracking flow, and reward system built entirely in Bubble.

3-5xHigher Conversion
6Data Types
First PaymentReward Trigger
⏱ 12 min read · Bubble.io · 2026

The Economics of a Referral Program

A customer who signs up through a referral converts at 3–5× the rate of paid traffic, churns at half the rate, and has a 16% higher lifetime value. Every SaaS that reaches product-market fit should have a referral program — not as a growth hack, but as a structural acquisition channel that compounds over time. Building one in Bubble takes less than a week and requires no third-party tools.

3–5×

Higher conversion vs. paid traffic
50%

Lower churn for referred customers
16%

Higher LTV than non-referred customers
$0

Marginal cost per referral sent

The Referral Data Model

🔗ReferralCode
workspace→ Workspace
codetext (unique)
created_by→ User
times_usednumber
total_earnednumber
is_activeyes/no

📋Referral
code→ ReferralCode
referred_workspace→ Workspace
referrer_workspace→ Workspace
statusoption set
reward_creditedyes/no
reward_amountnumber

💰ReferralReward
referral→ Referral
recipient_workspace→ Workspace
typeoption set
amountnumber
applied_atdate
expires_atdate

⚙️ReferralProgram
referrer_reward_typeoption set
referrer_reward_valuenumber
referee_reward_typeoption set
referee_reward_valuenumber
trigger_eventoption set
is_activeyes/no

💸Credit
workspace→ Workspace
amountnumber
sourceoption set
expires_atdate
is_usedyes/no

🏥Workspace (extra)
referral_code→ ReferralCode
referred_by→ Workspace
credit_balancenumber
total_referralsnumber

How the Referral Program Works End-to-End

1
Generate a unique code for every workspace
// On workspace creation — always auto-generate a referral code
Create ReferralCode:
workspace = new Workspace
code = random 8-char alphanumeric (Toolbox plugin)
created_by = Current User
is_active = yes
Update Workspace:
referral_code = new ReferralCode
2
Referrer shares their link

Display the referral link prominently in Settings and onboarding: yourapp.com/signup?ref=ABC123. One-click copy button using the Clipboard plugin. Show the referral dashboard: how many signups used the code, total rewards earned, credit balance.

3
New signup with referral code
// Signup page: read ?ref= URL parameter
On page load: Store ref code in custom state
On workspace creation:
Only when: ref code state is not empty
Find ReferralCode [code = ref state, is_active = yes]
Update Workspace: referred_by = found ReferralCode’s workspace
Create Referral: code=found, referred_workspace=new, status=Pending
4
Trigger reward after qualifying event

On checkout.session.completed webhook: find any Referral where referred_workspace = this workspace and status = Pending. Set status = Converted, reward_credited = yes. Create Credit records for both referrer and referee. Update ReferralCode’s times_used and total_earned. Update both Workspace credit_balance fields.

💡

Reward on First Payment, Not on Signup

Only credit rewards when the referred workspace makes their first real payment. Rewarding on signup creates fraud — people create fake accounts purely to farm referral credits. First paid invoice is the correct trigger, verified via the Stripe webhook, not the user’s self-reported action.

Ready to Build on Bubble?

Architecture, data model design, Stripe billing, and full SaaS builds — done right from day one.

Book a Free Call →See Our Work

Simple Automation Solutions

Business Process Automation, Technology Consulting for Businesses, IT Solutions for Digital Transformation and Enterprise System Modernization, Web Applications Development, Mobile Applications Development, MVP Development

Copyright © 2026