bounce_rate | R Documentation |
Calculates the "bounce rate" within a set of sessions - the proportion of sessions consisting only of a single event.
bounce_rate(sessions, user_id = NULL, precision = 2)
sessions |
a sessions dataset, presumably generated with
|
user_id |
a column that contains unique user IDs. NULL by default; if set, the assumption will be that you want per-user bounce rates. |
precision |
the number of decimal places to round the output to - set to 2 by default. |
either a single numeric value, representing the percentage of sessions
overall that are bounces, or a data.frame of user IDs and bounce rates if
user_id
is set to a column rather than NULL.
sessionise
for session reconstruction, and
session_length
, session_count
and
time_on_page
for other session-related metrics.
#Load and sessionise the dataset data("session_dataset") sessions <- sessionise(session_dataset, timestamp, uuid) # Calculate overall bounce rate rate <- bounce_rate(sessions) # Calculate bounce rate on a per-user basis per_user <- bounce_rate(sessions, user_id = uuid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.