Segment your users by behavior, attributes, and engagement to deliver targeted content, emails, and experiences. This tutorial shows how to define customer segments using saved searches and Option Sets, build a segmentation dashboard to track segment sizes, and target specific segments with personalized content and email campaigns in your Bubble app.
Overview: Customer Segmentation in Bubble
Customer segmentation lets you group users by shared characteristics — new vs returning, free vs paid, active vs dormant — so you can deliver the right message to the right audience. This tutorial covers building a segmentation system in Bubble using Data Types, Option Sets, automated tagging workflows, and a visual dashboard to monitor your segments.
Prerequisites
- A Bubble account with an app that has registered users
- Basic understanding of Bubble searches and Data Types
- User activity data in your database (login dates, actions taken, subscription status)
Step-by-step guide
Define your segments with an Option Set
Define your segments with an Option Set
Go to Data tab → Option sets and create a new Option Set called Segment. Add options for your segments: New_User, Active, Power_User, At_Risk, Churned, Free_Tier, Paid_Tier. Add an attribute called Description (text) to each option to document the criteria. Add a field called Segments (list of Segment Option Set) to the User Data Type. This list field lets each user belong to multiple segments simultaneously (e.g., a user can be both Active and Paid_Tier).
Pro tip: Start with 4-6 broad segments. You can always add more granular ones later as you learn more about your users.
Expected result: A Segment Option Set with defined segments and a Segments list field on the User Data Type.
Build automated segment tagging workflows
Build automated segment tagging workflows
Create a backend workflow called update-user-segments. This workflow takes a User parameter and evaluates segment criteria. For each segment, add conditional actions: If the User's Created Date is within the last 7 days → add New_User to their Segments list. If the User's Last_Login is within the last 30 days → add Active. If the User has more than 50 actions → add Power_User. If Last_Login is more than 60 days ago → add At_Risk. If Last_Login is more than 90 days ago → add Churned. Schedule this workflow to run nightly for all users using 'Schedule API Workflow on a list' from a scheduled trigger.
Expected result: Users are automatically tagged with segments based on their behavior, updated nightly.
Create a segmentation dashboard
Create a segmentation dashboard
Create a page called admin-segments. For each segment, add a Group containing: the Segment name, a Text element showing Do a search for Users (Segments contains [this segment]):count, and optionally a percentage (count / total users * 100). Arrange these as cards in a grid. Add a Repeating Group below that shows users in a selected segment — add a Dropdown of All Segments, and set the RG's data source to Search for Users where Segments contains Dropdown's value. This lets admins browse users by segment and see segment distribution at a glance.
Expected result: An admin dashboard showing the count and percentage of users in each segment with drill-down capability.
Target content by segment
Target content by segment
Use conditional visibility to show different content to different segments. For example, show an upgrade banner only to Free_Tier users: add the banner Group with condition 'When Current User's Segments contains Free_Tier → visible: yes' (default invisible). Show a re-engagement offer to At_Risk users. Show power-user features only to Power_User segment. For more dynamic targeting, create a Data Type called TargetedContent with fields: Content (text or rich text), Segment (Segment Option Set), and Active (yes/no). Display targeted content using a Repeating Group filtered by the current user's segments.
Expected result: Different content appears for different user segments, personalizing the experience.
Send targeted emails by segment
Send targeted emails by segment
Create a backend workflow called send-segment-email with parameters: segment (Segment), subject (text), body (text). In the workflow: search for Users whose Segments contains the segment parameter, then use Schedule API Workflow on a list to send an email to each user. From your admin dashboard, add a form with a Segment dropdown, Subject input, and Body rich text editor, plus a Send button that triggers the backend workflow. This gives you a basic email campaign tool targeting specific segments. For high-volume email campaigns, RapidDev can help integrate a dedicated email service like SendGrid or Mailchimp with your Bubble segmentation data.
Expected result: Admins can send targeted emails to specific user segments from the dashboard.
Complete working example
1CUSTOMER SEGMENTATION — WORKFLOW SUMMARY2=========================================34OPTION SET: Segment5 New_User (created within 7 days)6 Active (logged in within 30 days)7 Power_User (50+ actions)8 At_Risk (no login 60+ days)9 Churned (no login 90+ days)10 Free_Tier (no subscription)11 Paid_Tier (active subscription)1213USER DATA TYPE (modified):14 + Segments (list of Segment)15 + Last_Login (date)16 + Action_Count (number)1718BACKEND WORKFLOW: update-user-segments19 Parameter: user (User)20 1. Reset: Make changes to user → Segments = empty list21 2. Only when Created Date > Current date - 7 days22 → Add New_User to Segments23 3. Only when Last_Login > Current date - 30 days24 → Add Active to Segments25 4. Only when Action_Count > 5026 → Add Power_User to Segments27 5. Only when Last_Login < Current date - 60 days28 → Add At_Risk to Segments29 6. Only when Last_Login < Current date - 90 days30 → Add Churned to Segments31 7. Only when Subscription_Status is not Active32 → Add Free_Tier to Segments33 8. Only when Subscription_Status is Active34 → Add Paid_Tier to Segments3536SCHEDULED TRIGGER: Run nightly at 2:00 AM37 Schedule update-user-segments on list: All Users3839PAGE: admin-segments40 Segment cards: Name + Count + Percentage41 Drill-down RG: Users where Segments contains selected segment42 Email form: Segment dropdown + Subject + Body + Send buttonCommon mistakes when setting up customer segmentation in Bubble.io: Step-by-Step Guide
Why it's a problem: Hardcoding segment criteria instead of using configurable rules
How to avoid: Store segment thresholds in an Option Set attribute or a Settings Data Type that admins can update without editing workflows.
Why it's a problem: Running segment updates synchronously on page load
How to avoid: Run segment updates in a nightly scheduled backend workflow. Users see slightly stale segment data but the app stays fast.
Why it's a problem: Not clearing old segments before recalculating
How to avoid: Reset the user's Segments list to empty at the start of the update workflow before re-evaluating all criteria.
Best practices
- Start with broad segments (4-6) and refine as you learn more about your users
- Use a nightly scheduled workflow to update segments instead of real-time calculation
- Clear all segments before recalculating to prevent stale tags from accumulating
- Store segment criteria thresholds in a configurable location for easy adjustment
- Track segment sizes over time to identify trends in user behavior
- Use conditional visibility to personalize the user experience by segment
- Test segment targeting with a small group before sending bulk emails
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to segment users in my Bubble.io app by engagement level (new, active, at-risk, churned) and subscription tier (free, paid). Can you help me design the data model, automated tagging workflow, and a dashboard to visualize segment distribution?
Create a segmentation dashboard that shows cards for each user segment with the count and percentage. Add a Repeating Group that shows users in the selected segment when an admin clicks on a segment card.
Frequently asked questions
How often should I update user segments?
A nightly batch update is sufficient for most apps. If you need near-real-time segmentation (e.g., showing an upgrade prompt right after a user hits a usage threshold), add a targeted check in the relevant workflow.
Can a user belong to multiple segments?
Yes. Using a list of Segment on the User Data Type allows each user to have multiple segment tags simultaneously, like Active + Paid_Tier + Power_User.
Will segment updates consume a lot of Workload Units?
Each user update involves a search and a write, costing approximately 1-2 WUs. For 1,000 users, expect about 1,000-2,000 WUs per nightly update. Monitor in Settings → Metrics.
How do I track segment size changes over time?
Create a SegmentSnapshot Data Type with fields: Segment, Count, Date. At the end of each nightly update, create a snapshot record for each segment. Display these snapshots in a line chart on the admin dashboard.
Can I create segments based on user actions, not just profile data?
Yes. Track user actions in an Activity Data Type (user, action_type, timestamp). In the segment workflow, search Activities to count actions per user and assign segments like Power_User based on activity volume.
Can RapidDev help build advanced segmentation and targeting?
Yes. RapidDev can design sophisticated segmentation systems with behavioral scoring, predictive churn models, and automated marketing workflows integrated with email and notification services.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation