Learn R Programming

shinyga (version 0.1.2.9001)

doSegmentMacro: Quick setup of shinyga segments

Description

This function creates the menu and fetches the GA segments.

Usage

doSegmentMacro(input, output, session, token)

Arguments

input
Shiny input object.
output
Shiny output object.
session
Shiny session object.
token
GA token.

Value

A segment tableA DataTable called from ui.r by renderDataTable('SegmentTable')A selectInput('menuSeg') called from ui.r by uiOutput("controlSeg") and input$menuSeg

See Also

Other shiny macro functions: authDropdownRow; metricSelect; renderAuthDropdownRow

Examples

Run this code
## Not run: 
# 
# 
# ## client info taken from Google API console.
# CLIENT_ID      <-  "xxxxx.apps.googleusercontent.com"
# CLIENT_SECRET  <-  "xxxxxxxxxxxx"
# CLIENT_URL     <-  'https://mark.shinyapps.io/ga-effect/'
# ## comment out for deployment, in for local testing via runApp(port=6423)
# CLIENT_URL     <-  'http://127.0.0.1:6423'
# 
# securityCode <- createCode()
# 
# shinyServer(function(input, output, session)){
# 
#   ## returns list of token and profile.table
#   auth <- doAuthMacro(input, output, session,
#                       securityCode,
#                       client.id     = CLIENT_ID,
#                       client.secret = CLIENT_SECRET,
#                       client.uri    = CLIENT_URL)
# 
#   ga.token         <- auth$token
#   profile.table    <- auth$table
# 
#   segments <- doSegmentMacro(input, output, session,
#                              token=ga.token())
# 
#   }
# ## End(Not run)

Run the code above in your browser using DataLab