Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

accountPicker

accountPicker UI Shiny Module - pick GA4 accounts/webProperties in Shiny


Description

Makes a dropdown row for use for authentication with GA4 web properties.

Shiny Module for use with accountPickerUI

Usage

accountPickerUI(id, width = NULL, inColumns = FALSE)

accountPicker(id, ga_table, id_only = TRUE)

Arguments

id

Shiny id

width

The width of the input

inColumns

Whether to wrap selectInputs in width=4 columns

ga_table

A table GA4 accounts/web properties from ga_account_summary("ga4")

id_only

Whether to return just the id, not the row

Value

If id_only=FALSE, the row of ga_table for the selected GA4 web property e.g. use ga_table$propertyId to send to ga_data calls. If id_only=TRUE, just the propertyId

See Also

Examples

## Not run: 

ui <- fluidPage(title = "Shiny App",
                 accountPickerUI("auth_menu", inColumns = TRUE))
server <- function(input, output, session){
  token <- gar_shiny_auth(session)
  
  accs <- reactive({
    req(token)
    ga_account_list("ga4")
   })
   
  # module for authentication
  property_id <- accountPicker("auth_menu", ga_table = accs, id_only = TRUE)
 }
 
 shinyApp(gar_shiny_ui(ui, login_ui = silent_auth), server)


## End(Not run)

googleAnalyticsR

Google Analytics API into R

v1.0.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Artem Klevtsov [ctb], Johann deBoer [ctb], David Watkins [ctb], Olivia Brode-Roger [ctb], Jas Sohi [ctb], Zoran Selinger [ctb], Octavian Corlade [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.