Description Usage Arguments Value See Also Examples
This function creates the menu and fetches the GA segments.
1 | doSegmentMacro(input, output, session, token)
|
input |
Shiny input object. |
output |
Shiny output object. |
session |
Shiny session object. |
token |
GA token. |
A segment table
A DataTable called from ui.r by renderDataTable('SegmentTable')
A selectInput('menuSeg') called from ui.r by uiOutput("controlSeg") and input$menuSeg
Other shiny macro functions: authDropdownRow
;
metricSelect
;
renderAuthDropdownRow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.