/bubble-tutorials

How to build a user referral system in Bubble

Learn how to build a powerful user referral system in Bubble with clear steps, tips, and best practices to boost growth and engagement.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to build a user referral system in Bubble

A simple and valid referral system in Bubble works like this: every user gets a unique referral code, you store who referred whom when a new user signs up through that code, and then you trigger rewards using backend workflows. The whole system is just a combination of: a field on the User, a URL parameter, and a backend workflow that credits the referrer.

 

Create the data fields

 

Add two fields to the User data type:

  • referral\_code (text)
  • referred\_by (User)

When a user signs up, generate their referral\_code using a backend workflow so it’s always unique.

 

Generate the referral code

 

Create a backend workflow “generate-referral-code” that runs on user sign‑up:

  • Make changes to User = Current User
  • Set referral\_code = Calculate random string (length ~8)

 

// This runs after signup and assigns a unique code
referral_code = calculate random string  

 

Share referral links

 

A referral link is simply your signup page with a URL parameter:

  • example.com/signup?ref=Current User's referral\_code

Users can share that link anywhere.

 

Detect the referral on signup

 

On your signup page:

  • Add a page load workflow
  • If Get data from page URL: ref is not empty, store it in a custom state (easiest) or a temporary field in the database if needed

 

Attach the referral to the new user

 

After creating the account:

  • Search for User where referral\_code = Get data from page URL: ref
  • If found, set New User's referred\_by = that User
  • Trigger a backend workflow to award the referrer

 

// After account creation
New User.referred_by = Search for Users:first item  

 

(Optional) Give rewards

 

Create a backend workflow “award-referrer” that:

  • Takes parameter: referrer (User)
  • Makes changes to referrer (ex: add credits, mark referral as completed, etc.)

This keeps rewards secure since they run server-side.

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences