How Amplitude calculates session length

Amplitude calculates session length via the following formula when session ID is used as the session property:

1*max(client\_event\_time) - min(client\_event\_time)*

Where:

  • client_event_time is the local timestamp (UTC) when the device logged the event
  • max(client_event_time) is the local timestamp (UTC) of the last event logged by the device

Additionally, hidden, inactive, and deleted events will not be included in the session length calculation. For example, let's say you have the following series of events:

Event A --> Event B --> Event C --> Event D

If Event C and Event D are hidden, inactive, or deleted, then the max(client_event_time) is taken from Event B instead of Event D. 

Read more about how Amplitude tracks sessions in this help center article

Was this page helpful?

Thanks for your feedback!

July 4th, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.