How to detect when a user is logged in

How do you define to view your app? :grinning_face_with_smiling_eyes:

I guess you refer to having the app opened in a focused browser tab.

You can have a Do every X seconds workflow that

  • Updates a lastFirstVisitOfDay (date) field in the User table.
  • Executes only if the value of the field is not a today’s timestamp.
  • Increases a counter stored in dailyAppVisits (number) of table User.

Disclaimer: Do every X seconds workflows stop executing when the User loses connection with Bubble servers under some circunstances, e.g. suffers a connection outage or hibernates the device. So, test if this is enough for your use case, otherwise you’ll need a more convoluted solution similar to what I exposed in User presence system design (user online/offline status).