Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Look at the major versions of browsers being used by your users
- # by jwgayler @ Measure Slack
- ga_auth()
- #Alter filter to look at OS of choice
- browser_type <- google_analytics(id = your_ga_id,
- start = date_start,
- end = date_end,
- metrics = "sessions",
- dimensions = c("browser", "browserVersion"),
- filters = "ga:operatingSystem==Windows",
- max = 9999
- )
- # Extract major browser version and sort dataframe
- browser_type <- browser_type %>%
- arrange(-sessions) %>%
- mutate(major_version = str_sub(browserVersion, end = 2)) %>%
- group_by(browser, major_version) %>%
- summarise(session_count = sum(sessions)) %>%
- arrange(-session_count) %>%
- ungroup() %>%
- mutate(proportion = scales::percent(session_count / sum(session_count)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement