session_length: Calculate session length

View source: R/metrics.R

session_lengthR Documentation

Calculate session length

Description

Calculate the overall length of each session.

Usage

session_length(sessions)

Arguments

sessions

a dataset of sessions, presumably generated with sessionise.

Value

a data.frame of two columns - session_id, containing unique session IDs, and session_length, containing the length (in seconds) of that particular session.

Please note that these lengths should be considered a minimum; because of how sessions behave, calculating the time-on-page of the last event in a session is impossible.

See Also

sessionise for session reconstruction, and time_on_page, session_count and bounce_rate for other session-related metrics.

Examples

#Load and sessionise the dataset
data("session_dataset")
sessions <- sessionise(session_dataset, timestamp, uuid)

# Calculate session length
len <- session_length(sessions)


reconstructr documentation built on March 18, 2022, 7:05 p.m.