Session time / duration?

Does anyone have a clean way to capture the duration of a user’s session?

Trying to capture this in a “session” data type with the following:

  • user
  • startTime
  • endTime
  • numActions

Or is this a job for Google Analytics?

As in how long someone was logged in for?

if so you might want to give the plugin effactive a try. or you can also use your start and end field as “Dates” data types. when a user loads the page you enter the time. and as long as they have the page active you update the end time every x sec/mins

Thanks - seems like a relatively simple way to accomplish this.

For anyone else wondering this, I ended up using the Google Analytics 4 plugin to capture this data as well as some custom events. Really simple implementation and gives all of the engagement, growth, & retention metrics I needed.

2 Likes

I was skimming over some info on google analytics. but how is it data wise. i assume it has to be constantly be feeding data to their servers.

It’s pretty lightweight AFAIK (no heavy data passing back and forth) and you can control the events. I doubt users would see a substantial jump in data usage for your app if that’s the concern, but it would be somewhat dependent on the events you implement.

For anyone looking for the exact plugin, here’s the link:

This topic was automatically closed after 70 days. New replies are no longer allowed.