W10-Dashboards Assignment

Project 1

Author

Juan De La Cruz

Published

April 6, 2026

Project 1

Project Description

This static marketing dashboard summarizes campaign performance across time using key metrics such as CTR, CPC, CPA, and ROAS. The goal is to provide a quick, visual overview of how different campaigns perform and where optimization opportunities exist. The dashboard is designed for marketing stakeholders who need a high-level view of trends without interacting with filters.

Data Description

The dataset contains marketing performance data at the campaign and date level. Each row represents a campaign on a specific date, with variables such as impressions, clicks, cost, conversions, CTR, CPC, CPA, and ROAS. The data covers [insert time range if known], and is used to evaluate efficiency and effectiveness across campaigns.

R Codes

Code
library(dplyr)
library(lubridate)

set.seed(123)

# Create 90 days of data
dates <- seq.Date(from = as.Date("2024-01-01"),
                  to = as.Date("2024-03-31"),
                  by = "day")

campaigns <- c("Brand Awareness", "Retargeting", "Search", 
               "Social Media", "Influencer", "Email")

df <- expand.grid(
  date = dates,
  campaign = campaigns
)

# Generate synthetic metrics
df <- df |>
  mutate(
    spend = round(runif(n(), 50, 500), 2),
    impressions = round(runif(n(), 5000, 50000)),
    clicks = round(impressions * runif(n(), 0.005, 0.03)),
    conversions = round(clicks * runif(n(), 0.02, 0.15)),
    revenue = round(conversions * runif(n(), 20, 150), 2)
  ) |>
  mutate(
    CTR = clicks / impressions,
    CPC = spend / clicks,
    CPA = spend / conversions,
    ROAS = revenue / spend
  )

write.csv(df, "data/marketing_data.csv", row.names = FALSE)
Code
library(dplyr)
library(ggplot2)
library(readr)

df <- read_csv("data/marketing_data.csv")

ROAS Over Time

Code
df |>
  group_by(date) |>
  summarise(avg_roas = mean(ROAS)) |>
  ggplot(aes(date, avg_roas)) +
  geom_line(color = "#0072B2", linewidth = 1) +
  labs(title = "Average ROAS Over Time",
       y = "ROAS",
       x = "Date")

Explanation

ROAS Over Time shows how efficiently each campaign generated revenue relative to spend across the 90‑day period. The chart highlights clear performance patterns: some campaigns maintain consistently strong ROAS, while others fluctuate or decline over time. Peaks in ROAS often align with periods of higher conversion efficiency, while dips may indicate overspending or weaker audience engagement. This visualization helps identify which campaigns deliver the strongest long‑term return and which may require budget adjustments or creative refreshes.

CTR by Campaign

Code
df |>
  group_by(campaign) |>
  summarise(avg_ctr = mean(CTR)) |>
  ggplot(aes(reorder(campaign, avg_ctr), avg_ctr, fill = campaign)) +
  geom_col() +
  coord_flip() +
  labs(title = "CTR by Campaign",
       y = "CTR",
       x = "Campaign")

Explanation

CTR by Campaign compares how effectively each campaign drives user engagement. Campaigns with higher CTR are successfully capturing attention and generating interest, while lower‑CTR campaigns may need improved targeting or messaging. This chart makes it easy to spot top‑performing campaigns (e.g., Social Media or Influencer) versus those that underperform. Understanding CTR differences helps guide decisions about where to allocate spend to maximize engagement.

Spend vs Revenue Scatter Plot

Code
df |>
  ggplot(aes(spend, revenue, color = campaign)) +
  geom_point(alpha = 0.6, size = 2) +
  labs(title = "Spend vs Revenue",
       x = "Spend ($)",
       y = "Revenue ($)")

Explanation

The Spend vs Revenue scatter plot visualizes the relationship between advertising investment and the revenue generated. Campaigns that appear above the trend line are outperforming expectations—producing strong revenue relative to spend—while those below the line are less efficient. Clusters of points reveal whether certain campaigns consistently deliver strong returns or struggle to convert spend into revenue. This chart is especially useful for identifying which campaigns deserve increased budget and which may need optimization.

Findings From Data

The static dashboard reveals several clear performance patterns across the 90‑day marketing dataset. ROAS Over Time shows that campaign efficiency fluctuates throughout the quarter, with certain campaigns maintaining consistently strong returns while others experience noticeable dips. These shifts suggest periods where campaigns either resonated strongly with audiences or struggled to convert spend into revenue, highlighting opportunities for optimization.

The CTR by Campaign comparison makes engagement differences immediately visible. Some campaigns, such as Social Media or Influencer (example), generate higher CTR, indicating stronger audience interest and more effective creative or targeting. Lower‑CTR campaigns may require adjustments in messaging, audience segmentation, or placement strategy to improve engagement.

The Spend vs Revenue scatter plot provides a clear view of campaign efficiency. Campaigns positioned above the trend line are generating strong revenue relative to their spend, while those below the line are underperforming. This visualization helps identify which campaigns are delivering profitable returns and which may need budget reductions, creative refreshes, or strategic changes.

Overall, the dashboard highlights meaningful differences in campaign performance, helping marketers quickly identify high‑performing strategies, diagnose inefficiencies, and make more informed budget allocation decisions.

Project 2

Project Description

This project extends the static dashboard from Project 1 by creating an interactive Shiny application that allows users to explore marketing performance data dynamically. Instead of viewing fixed charts, users can filter by date range, campaign, and performance metric (CTR, CPC, CPA, ROAS) to uncover deeper insights. The goal of this interactive app is to give marketing stakeholders a flexible tool to analyze trends, compare campaign performance, and identify optimization opportunities in real time.

Data Description

The dataset used in this Shiny app contains 90 days of synthetic marketing performance data across six campaigns. Each row represents a campaign on a specific date and includes variables such as impressions, clicks, conversions, spend, revenue, CTR, CPC, CPA, and ROAS. This dataset enables users to explore how performance metrics change over time and how different campaigns compare in efficiency and engagement.

R Codes

library(shiny)
library(dplyr)
library(ggplot2)
library(readr)

# Load dataset (CSV must be in the same folder as app.R)
df <- read_csv("marketing_data.csv")

ui <- fluidPage(
  titlePanel("Marketing Performance Explorer"),
  
  sidebarLayout(
    sidebarPanel(
      dateRangeInput(
        "daterange", 
        "Select Date Range:",
        start = min(df$date),
        end = max(df$date)
      ),
      
      selectInput(
        "campaign", 
        "Choose Campaign:",
        choices = unique(df$campaign)
      ),
      
      selectInput(
        "metric", 
        "Choose Metric:",
        choices = c("CTR", "CPC", "CPA", "ROAS")
      )
    ),
    
    mainPanel(
      plotOutput("trendPlot"),
      tableOutput("summaryTable")
    )
  )
)

server <- function(input, output) {
  
  filtered <- reactive({
    df |>
      filter(
        date >= input$daterange[1],
        date <= input$daterange[2],
        campaign == input$campaign
      )
  })
  
  output$trendPlot <- renderPlot({
    filtered() |>
      ggplot(aes(date, .data[[input$metric]])) +
      geom_line(color = "#0072B2", linewidth = 1) +
      labs(
        title = paste(input$metric, "Trend for", input$campaign),
        x = "Date",
        y = input$metric
      )
  })
  
  output$summaryTable <- renderTable({
    filtered() |>
      summarise(
        Average = mean(.data[[input$metric]], na.rm = TRUE),
        Minimum = min(.data[[input$metric]], na.rm = TRUE),
        Maximum = max(.data[[input$metric]], na.rm = TRUE)
      )
  })
}

shinyApp(ui, server)

Key Findings From the Data

The interactive app reveals several meaningful insights about campaign performance. Users can see how metrics such as CTR, CPC, CPA, and ROAS evolve over time and how different campaigns compare when filters are applied. Some campaigns show consistently strong efficiency, while others fluctuate depending on the date range selected. The ability to switch metrics highlights how a campaign may perform well in one area (e.g., CTR) but poorly in another (e.g., CPA), helping marketers identify strengths and weaknesses more clearly.

Interpretation of the Dashboard Charts

The interactive line chart allows users to explore trends for any selected metric across time. This helps identify spikes, dips, and patterns that may be tied to campaign strategy, seasonality, or audience behavior. The summary table complements the chart by providing quick numerical insights such as average, minimum, and maximum values for the selected metric. Together, these visuals give users a deeper understanding of campaign performance and support more informed decision‑making.