-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/#169 incorrect count anon users #170
Issue/#169 incorrect count anon users #170
Conversation
Add `anon_user` as prefix to auto generated usernames for anonymous users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All anonymous users are being tracked as a single one if track_anonymous = FALSE
diff --git a/inst/examples/app/instrumentation/app.R b/inst/examples/app/instrumentation/app.R
index a6c9722..e7cf8bf 100644
--- a/inst/examples/app/instrumentation/app.R
+++ b/inst/examples/app/instrumentation/app.R
@@ -112,7 +112,8 @@ counter_server <- function(id) {
shinyApp(ui = ui, server = function(input, output, session) {
telemetry$start_session(
track_values = TRUE,
- navigation_input_id = "uisidebar"
+ navigation_input_id = "uisidebar",
+ track_anonymous_user = FALSE
)
# server code
I think this could be solved by either:
- When counting users: add every unique session without user (
is.na(.data$username)
)- see below
- On
Telemetry$get_user
the default value returns a unique string (such aspaste0("anon_user_", session$token)
or a generated one)
total_users <- length(
unique(
selected_log_data() %>%
dplyr::filter(.data$type == "login") %>%
dplyr::filter(.data$username != "") %>%
dplyr::pull(.data$username)
)
) +
length(
unique(
selected_log_data() %>%
dplyr::filter(.data$type == "login") %>%
dplyr::filter(is.na(.data$username)) %>%
dplyr::pull(.data$session)
)
)
all the suggested changes have been implemented.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff was just to show how to test the application.
I've reverted it.
All good! Have a great weekend
Closes #169
Changes description
Definition of done
NEWS.md
file has been updatedx.y.z.90XX
)Development
)