## Not run:
#
# securityCode <- createCode()
#
# shinyServer(function(input, output, session)){
#
# ## returns list of token and profile.table
# ## client info taken from Google API console.
# auth <- doAuthMacro(input, output, session,
# securityCode,
# client.id = "xxxxx.apps.googleusercontent.com",
# client.secret = "xxxxxxxxxxxx",
# type = "analytics"
# )
#
# ga.token <- auth$token
# profile.table <- auth$table
#
# ## call the token for API calls
#
# gadata <- reactive({
#
# rollupGA(GAProfileTable = profile.table(),
# dimensions = 'ga:date',
# start_date = '2014-03-13',
# end_date = '2015-03-13'
# metrics = 'ga:sessions',
# ga = ga.token())
# })
#
# }
# ## End(Not run)
Run the code above in your browser using DataLab