Skip to content

Instantly share code, notes, and snippets.

@33sticks
Created October 6, 2020 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 33sticks/7656ee2644d562e281738b9863ec2e43 to your computer and use it in GitHub Desktop.
Save 33sticks/7656ee2644d562e281738b9863ec2e43 to your computer and use it in GitHub Desktop.
Shiny server.R
# Load Shiny
library(shiny)
# Define server logic required to request summary data from Adobe Analytics
shinyServer(function(input, output) {
# Load RSiteCatalyst
library("RSiteCatalyst")
# Listen for a click on the 'Get Report Suite Summary' button
observeEvent(input$getRS, {
# Authenticate using the user supplied credentials
SCAuth(input$user, input$secret)
# Builds report reqeust using user inputted parameters
date.from <- input$dateStart
date.to <- input$dateEnd
reportsuite.id <- input$rsid
metrics <- c("visits","uniquevisitors","pageviews")
# Add a progress indicator
withProgress(message = 'Generating Summary...', value = 0.5, {
# Get the report
report.data <- QueueOvertime(reportsuite.id, date.from, date.to, metrics)
# Send the report data to the UI
output$summary <- renderDataTable(
report.data
)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment