Description Usage Arguments Examples
One simple satisfaction heuristic is to look at the dwell time
a user has on each page in a session and whether any one of those
dwell-times exceeds a certain threshold. If it does, that session is deemed
to be one in which the user was satisfied. dwell_time
calculates
that for a data.frame of user sessions.
1 | dwell_time(data, id_col, ts_col, dwell_threshold = 100)
|
data |
a |
id_col |
the name or index of the column containing unique session IDs |
ts_col |
the name or index of the column containing timestamps |
dwell_threshold |
the value (in seconds) to use to indicate a "successful" session |
1 2 3 4 5 6 7 8 9 10 11 12 | # Data:
ts <- as.POSIXct(
c("2016-03-01T06:52:49Z", "2016-03-01T06:53:19Z", "2016-03-01T06:53:39Z"),
format = "%Y-%m-%dT%H:%M:%SZ", tz = "UTC"
)
x <- data.frame(timestamp = ts, session_id = "0024c4506bf92e1c")
# Use default threshold:
dwell_time(x, "session_id", "timestamp")
# Use 10s threshold:
dwell_time(x, "session_id", "timestamp", 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.