Solved

Creating a derived property to measure time between events

  • 25 August 2022
  • 3 replies
  • 463 views

I would like to understand if it is possible to use derived properties to essentially calculate the amount of time between specific events -- without needing to touch the code. I understand that it is possible to create a duration property as discussed here, however the implementation for this would be complex. Is there a simpler way to accomplish that, or something similar, with derived properties?

To be more specific, I am primarily interested in looking at users who have a session length of greater than some number of minutes (3, 5, 15, for example), which is specific to how I expect users to navigate through the product.

icon

Best answer by Saish Redkar 25 August 2022, 21:56

View original

3 replies

Userlevel 7
Badge +10

Hey @demarshall 

If I’m understanding your use case correctly, then using the User Sessions chart would be a better option.

You can create a demo sessions chart like this - https://analytics.amplitude.com/demo/chart/new/0cwrdll and then extract the cohort of users from the desired time spent bucket. e.g. extract cohort of users who spent 5-10 mins in your app in the last 7 days.

Hope this helps.

Hi @Saish Redkar,

Thank you for your reply. I was aware of the user sessions chart, and that does come close to the result that I would like -- however, the issue is that the cohort extracted from this chart is always a static one. Therefore I would have to consistently create new cohorts from this chart to keep this group of users up-to-date. 

Are there any solutions that would enable me to create a dynamic cohort with these specifications, or similar?

 

Thanks.

Userlevel 6
Badge +8

Hi @demarshall ! Chiming in from Amplitude Support team :) 

Good thought on derived properties but, for derived properties, it’s not possible to take a property value from one event and subtract it with a property value from another event to get time between the two events. The derived properties create new properties based on properties that exist on one event itself. As such, unless you tracked the timestamp of the previous event on the current event (which will likely prompt you to touch code since this is currently not the set-up), derived properties won’t work. 

Saish’s suggestion is really good and probably the best workaround given the current capabilities and if you don’t want to touch code. However, it is the case that the cohort will be static and there isn’t a way to create a dynamic cohort with these specifications. 

I welcome you to share your feedback here regarding ability to track time between events as a property without needing to touch code: https://community.amplitude.com/ideas

Reply