Learn how to build a powerful affiliate system in Bubble, from tracking referrals to automating payouts, with this clear step-by-step guide.

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.
A simple and reliable affiliate system in Bubble works by generating a unique referral URL for each user, storing who referred whom, and triggering backend workflows to record commissions whenever a referred user performs a qualifying action (like making a purchase). Bubble already has everything you need: URL parameters, database fields, backend workflows, and Privacy Rules. No plugins required.
You create a User field like referral_code (text) and generate a unique code on signup. Then you detect a URL parameter like ?ref=abcd123 when a new visitor arrives. If they sign up, you store the referring user inside a field like referred_by (User). Later, when the referred user pays or completes an action, a backend workflow creates a Commission entry linked to the affiliate.
On signup, set User referral_code = Generate random string. To show users their affiliate link, combine your site URL with ?ref=Current User's referral_code. When any visitor lands, use Get data from page URL (parameter: ref) and store it temporarily in a referral\_code field in a state or cookie-equivalent (Bubble stores it until signup as long as you save it in a custom state or Option Set).
// Example backend workflow trigger
// When a new User is created:
Only when This User's referred_by is not empty:
Create a new Commission:
affiliate = This User's referred_by
referred_user = This User
amount = 0 // will be updated after payment
If you use Stripe, set a webhook to a Bubble backend workflow. When payment succeeds, look up the paying User, check referred\_by, and create or update a Commission. This avoids front‑end manipulation and keeps logic secure.
In Privacy Rules allow users to see only commissions where affiliate = Current User. Never calculate commissions on the front end. Always do it in backend workflows so users cannot spoof amounts.
 
Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.
Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!
Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.
Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.
Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.
Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.
Fix broken workflows | Optimize logic | Boost performance | Scale with confidence