Hi everyone! 
I’m building a native mobile app and need help with user activity tracking. I want to set up an active/inactive state system that can detect when users are truly active vs idle.
What I’m trying to achieve:
• Track when users are actively using the app (or on the app currently navigating between tabs.
• Build a item tracker data view when navigate through vertical list.
• Reset activity tracking when users return from background/foreground
Questions:
-
What’s the best approach for detecting user interactions across all views in mobile apps? At least knowing in which tab the user is in. I have already tried to set up thing using pages is loaded … or page is visible, but when a user navigate through all the tab both element are considered true
-
How can I reliably reset activity tracking states when users return from background? Or switch from a tab to another.
-
Are there mobile-specific events or workarounds for this type of functionality?
Any insights or alternative approaches would be greatly appreciated! Thanks in advance for your help.
There’s no single “global is-active event” in the mobile builder yet, but you can get pretty close with a combo of custom states, a “last active” timestamp on the User, and an idle‑detection pattern.
1. Track active tab / view
-
Add a current_tab custom state on a top‑level element (e.g. the main view or a layout group).
-
Whenever the user taps a tab item or you use “Go to view”, run a workflow that updates current_tab to that tab’s name.
-
Any “user is active in tab X” logic can just check that custom state instead of relying on page is loaded / page is visible, which as you noticed can be true for several views at once.
2. Track per‑user activity
-
Add fields on User like last_active (date) and is_active (yes/no).
-
On key interactions (scrolling the vertical list, clicking buttons, changing tabs, etc.), run a small workflow: Make changes to current user → last_active = Current date/time, is_active = yes.
-
You can have a recurring API workflow or a small “every X seconds” loop that checks Current date/time - Current User's last_active and sets is_active = no after, say, 60s of no interaction.
3. Handling background / foreground
-
For web apps, plugins like Flusk’s Idle Detector / activity & tab tracking can fire events when the user leaves or returns to a tab; if/when they get a mobile‑compatible version, that’s the easiest way to flip your is_active flag.
-
In the mobile builder, a common workaround is: when a view becomes visible (e.g. via a conditional or tab change), run a workflow that updates current_tab and last_active; when you land on a “home/shell” view after coming back from background, treat that as a “user is active again” event and reset your tracking.
It’s a bit of plumbing, but this combo (custom state for current tab + last_active timestamp + optional idle detector plugin) usually gives a reliable “active vs idle” signal and lets you know which tab the user is on across the whole mobile experience.