Simon Jenner
Tuesday, 17 January 2023
An active user is more valuable than a non active user so how do we track which of our users are active?
Posted in:
No-Code
When building an app, you’ll notice there’s a big difference between users and active users. Users are anyone who’s signed up, and while that number may make you feel good, it’s not the one that really matters.
Active users—those who return and engage with your app regularly—are the ones who truly determine your app’s success. They’re the people most likely to stick around, recommend your app, or even pay for it. In short, we need active users for a successful startup.
But how do you define and track an active user? It depends on your app type. For instance, a finance app might consider someone who logs in once a year active, whereas a gaming app might set the bar at logging in weekly. Personally, I find a 30-day activity window works for most apps.
Here’s how I’ve tackled this challenge with Bubble.io and some lessons I’ve learned along the way:
Why “Last Login” Isn’t Reliable for Bubble.io
Bubble.io doesn’t force users to log out when they leave your app. Most users simply close the tab or leave the browser open. This means the “Last Login” date Bubble provides isn’t always accurate. Someone could be actively using your app every day but never technically “log in” again. That’s why relying on this metric alone can give you a misleading picture of user activity.
Instead, I recommend tracking last active dates, a custom solution you can implement in Bubble. It’s simple, effective, and gives you a far better understanding of who’s genuinely engaging with your app.
How to Track Active Users in Bubble.io
Tracking active users in Bubble requires setting up a system that updates the user’s “Last Active” field whenever they interact with your app. Here’s the process I’ve refined, which strikes a balance between accurate data and app performance:
1. Add a “Last Active” Field to the User Data Type
This is your starting point. In your Bubble database, create a new field in the User data type. Call it LastActive and set the field type to Date.
2. Decide Where to Capture Activity
Think about the pages users visit most often, like a dashboard or homepage. These are the best places to update the LastActive field. For example, if your app’s primary interaction happens on a dashboard, set up workflows there.
3. Create Workflows to Update “Last Active”
Add workflows that update the LastActive field with the current date and time whenever users interact with these key pages. This way, you’ll always have up-to-date activity records for each user.
My Experience with Advanced Tracking: API vs. Standard Workflows
For better performance, I’ve found it’s often worth using Bubble’s Data API rather than workflows for frequently updated fields like LastActive. Here’s why:
Workflows and Performance: Triggering a workflow every few seconds to update the database can slow down your app, especially as your user base grows. Bubble’s Write Units (WUs) are limited, and this method can quickly eat them up.
Using the API: By making API calls instead, updates happen server-side, keeping your app’s front-end running smoothly. Configure an API call to update the LastActive field with the current timestamp every 10–30 seconds while users are logged in.
This API-based approach has been a game-changer for me, especially with larger user bases.
Additional Tracking Insights
Use Cases for “Last Active” Tracking
Tracking activity isn’t just for stats; it unlocks other functionality in your app:
Real-Time Status: Show if a user is “online” by comparing their LastActive timestamp to the current time.
Notifications: Send reminders or notifications only to inactive users.
Analytics: Understand which features keep users engaged and identify drop-off points.
Tools Like LogSnag for Event Tracking
For tracking specific actions (e.g., button clicks or feature use), I’ve experimented with tools like LogSnag. It integrates seamlessly with Bubble, allowing you to send and analyze custom user events. For example, tracking how often users complete a specific task can reveal which parts of your app need improvement.
Tips for Optimizing User Tracking
Minimize Database Writes: Update the LastActive field only when necessary. Avoid overloading the database with constant writes.
Segment Your Users: Group users based on activity levels (e.g., daily, weekly, or monthly active users) for more targeted insights.
Visualize Activity Data: Use charts or analytics tools to display trends in user activity, making it easier to interpret and act on the data.
In a nutshell
Bubble.io & Active Users
Bubble has no in-built function for tracking active users so it has to be built. A constant across all Bubble apps is the User Data type, so that is where we will create our data storage for last active.
Where to capture it
You want to update the users last active date on pages they are likely to visit regularly for example the dashboard. A typical app would have at least 3 workflow instances to update the users last active. There is no need to update last active for admin users.
Install Guide
Step 1: Add a Data Field to Track Last Active
Go to the Data tab in your Bubble editor.
Open the User data type (this is a built-in type in all Bubble apps).
Add a new field:
Field Name: LastActive
Field Type: Date
This field will store the timestamp of the user’s last activity.
Step 2: Identify Key Pages for Activity Updates
Decide which pages are frequently accessed by your users. These are the best locations to capture activity updates. Common examples include:
The dashboard
A homepage or landing page
Any other page where users perform regular actions
Step 3: Create Workflows to Update "LastActive"
For each key page, set up workflows that update the user's LastActive field when the page is visited or interacted with. Here’s how to do it:
Open the Page Editor: Navigate to the page where you want to track user activity (e.g., the dashboard).
Add a Workflow: Go to the Workflows tab and create a new workflow triggered by a suitable event. Examples include:
Page is loaded (if you want to track activity when the page opens).
Element is clicked (if you want to track specific user actions, like clicking a button).
Set the Action: Add a “Make changes to a thing” action:
Thing to change: Current User
Field to update: LastActive
Value: Current date/time
Step 4: Optimize Workflows for Performance
Avoid overloading the database by triggering updates only when necessary. For example:
Do not update the LastActive field on every interaction.
Use a condition like “Only when the user is logged in” to prevent unnecessary updates.
Step 5: Add the Workflow to Shared Components
To ensure comprehensive tracking, add the LastActive workflow to shared components like your app’s header or footer. These elements are present on multiple pages, allowing you to track activity across the app without duplicating workflows.
Edit the Header/Footer Component: Open the reusable element (e.g., header or footer).
Add the Workflow: Create a new workflow that updates the LastActive field every time the header/footer is loaded or interacted with.
Save Changes: These workflows will now run on any page that uses the header or footer, ensuring consistent tracking.
Step 6: Set Privacy Rules
To protect user data, configure privacy rules for the LastActive field:
Go to the Data tab and click on Privacy.
Set up a rule for the User data type:
Allow the Current User to view and update their own LastActive field.
Restrict access for other users unless explicitly needed (e.g., for admins).
Step 7: Test the Tracking System
Before rolling out your app, test the tracking system thoroughly:
Log in with a test account and navigate key pages.
Check the database to confirm that the LastActive field updates correctly.
Ensure workflows do not trigger multiple unnecessary updates.
Optional Enhancements
Real-Time Status: If you want to show a user’s online status, compare the LastActive timestamp to the current time and display “Online” if the difference is within a few minutes.
Analytics Dashboard: Build a dashboard to visualize active user trends over time (e.g., daily, weekly, or monthly active users).
Lessons Learned and Next Steps
Tracking active users has completely changed how I understand and improve my app. Knowing who’s genuinely engaging (and who isn’t) has helped me make smarter decisions about features, marketing, and retention strategies. Implementing these tracking methods in Bubble was easier than I expected, and the payoff has been well worth it.
If you’re building a Bubble app, I highly recommend setting up LastActive tracking as one of your first priorities. It’s a simple step that provides immense value over time.
Launch Your Startup Fast and Affordably! Our no-code approach is perfect for non-tech founders. With a simple 3-step process: START, LAUNCH, GROW, join over 1400 startups we've successfully launched. Start your journey today!
Join