Created
October 6, 2020 15:15
-
-
Save 33sticks/7656ee2644d562e281738b9863ec2e43 to your computer and use it in GitHub Desktop.
Shiny server.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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