This project analyzes marketing campaign performance, customer engagement, campaign effectiveness, and ROI-related business insights using data visualization techniques.
The dashboard focuses on: - customer behavior, - campaign response analysis, - customer segmentation, - marketing effectiveness, - and interactive business intelligence reporting.
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.2.1 ✔ readr 2.2.0
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.3 ✔ tibble 3.3.1
## ✔ lubridate 1.9.5 ✔ tidyr 1.3.2
## ✔ purrr 1.2.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
##
## The following object is masked from 'package:ggplot2':
##
## last_plot
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following object is masked from 'package:graphics':
##
## layout
library(corrplot)
## corrplot 0.95 loaded
library(readr)
library(scales)
##
## Attaching package: 'scales'
##
## The following object is masked from 'package:purrr':
##
## discard
##
## The following object is masked from 'package:readr':
##
## col_factor
marketing_data <- read_csv("marketing_campaign.csv")
## Rows: 2976 Columns: 17
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (4): Client ID, Client Type, Calendardate, Number of Competition
## dbl (13): Number of Customers, Montly Target, Zip Code, Amount Collected, Un...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(marketing_data)
## # A tibble: 6 × 17
## `Client ID` `Client Type` `Number of Customers` `Montly Target` `Zip Code`
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 ID-987275 Medium Facility 2800 125 1003
## 2 ID-987275 Medium Facility 2800 125 1003
## 3 ID-987275 Medium Facility 2800 125 1003
## 4 ID-987275 Medium Facility 2800 125 1003
## 5 ID-987275 Medium Facility 2800 125 1003
## 6 ID-987275 Medium Facility 2800 125 1003
## # ℹ 12 more variables: Calendardate <chr>, `Amount Collected` <dbl>,
## # `Unit Sold` <dbl>, `Campaign (Email)` <dbl>, `Campaign (Flyer)` <dbl>,
## # `Campaign (Phone)` <dbl>, `Sales Contact 1` <dbl>, `Sales Contact 2` <dbl>,
## # `Sales Contact 3` <dbl>, `Sales Contact 4` <dbl>, `Sales Contact 5` <dbl>,
## # `Number of Competition` <chr>
dim(marketing_data)
## [1] 2976 17
colnames(marketing_data)
## [1] "Client ID" "Client Type" "Number of Customers"
## [4] "Montly Target" "Zip Code" "Calendardate"
## [7] "Amount Collected" "Unit Sold" "Campaign (Email)"
## [10] "Campaign (Flyer)" "Campaign (Phone)" "Sales Contact 1"
## [13] "Sales Contact 2" "Sales Contact 3" "Sales Contact 4"
## [16] "Sales Contact 5" "Number of Competition"
marketing_data <- marketing_data %>%
mutate(
Estimated_CTR =
(`Campaign (Email)` +
`Campaign (Flyer)` +
`Campaign (Phone)`) /
`Number of Customers`,
Engagement_Score =
(`Amount Collected` +
`Unit Sold`) /
`Number of Customers`,
Estimated_ROI =
`Amount Collected` /
(`Campaign (Email)` +
`Campaign (Flyer)` +
`Campaign (Phone)` + 1)
)
kpi_summary <- data.frame(
KPI = c(
"Average CTR",
"Average Engagement Score",
"Average Estimated ROI"
),
Value = c(
round(mean(marketing_data$Estimated_CTR, na.rm = TRUE), 2),
round(mean(marketing_data$Engagement_Score, na.rm = TRUE), 2),
round(mean(marketing_data$Estimated_ROI, na.rm = TRUE), 2)
)
)
knitr::kable(kpi_summary)
| KPI | Value |
|---|---|
| Average CTR | Inf |
| Average Engagement Score | Inf |
| Average Estimated ROI | 6032330 |
campaign_summary <- data.frame(
Campaign = c(
"Email",
"Flyer",
"Phone"
),
Engagement = c(
sum(marketing_data$`Campaign (Email)`, na.rm = TRUE),
sum(marketing_data$`Campaign (Flyer)`, na.rm = TRUE),
sum(marketing_data$`Campaign (Phone)`, na.rm = TRUE)
)
)
ggplot(campaign_summary,
aes(x = Campaign,
y = Engagement,
fill = Campaign)) +
geom_bar(stat = "identity") +
labs(
title = "Campaign Acceptance Comparison",
x = "Campaign Type",
y = "Total Engagement"
)
ggplot(marketing_data,
aes(x = `Number of Customers`,
y = `Amount Collected`,
color = Estimated_ROI)) +
geom_point(size = 3,
alpha = 0.7) +
labs(
title = "Customer Spending vs Revenue",
x = "Number of Customers",
y = "Amount Collected"
)
ggplot(marketing_data,
aes(x = `Number of Customers`,
y = `Unit Sold`)) +
geom_line(color = "blue") +
labs(
title = "Website Activity vs Purchases",
x = "Customer Activity",
y = "Units Sold"
)
product_data <- data.frame(
Category = c(
"Email Campaign",
"Flyer Campaign",
"Phone Campaign"
),
Spending = c(
sum(marketing_data$`Campaign (Email)`, na.rm = TRUE),
sum(marketing_data$`Campaign (Flyer)`, na.rm = TRUE),
sum(marketing_data$`Campaign (Phone)`, na.rm = TRUE)
)
)
ggplot(product_data,
aes(x = Category,
y = Spending,
fill = Category)) +
geom_bar(stat = "identity") +
labs(
title = "Marketing Channel Spending",
x = "Campaign Category",
y = "Campaign Value"
)
ggplot(marketing_data,
aes(
x = `Number of Customers`,
y = `Amount Collected`,
size = Estimated_CTR,
color = Engagement_Score
)) +
geom_point(alpha = 0.7) +
labs(
title = "Customer Segmentation Analysis",
x = "Number of Customers",
y = "Amount Collected"
)
## Warning: Removed 63 rows containing missing values or values outside the scale range
## (`geom_point()`).
numeric_data <- marketing_data %>%
select(
Estimated_CTR,
Engagement_Score,
Estimated_ROI,
`Campaign (Email)`,
`Campaign (Flyer)`,
`Campaign (Phone)`,
`Amount Collected`,
`Unit Sold`
)
cor_matrix <- cor(
numeric_data,
use = "complete.obs"
)
corrplot(
cor_matrix,
method = "color"
)
interactive_plot <- ggplot(
marketing_data,
aes(
x = `Number of Customers`,
y = `Amount Collected`,
size = Engagement_Score,
color = Estimated_ROI
)
) +
geom_point(alpha = 0.8) +
labs(
title = "Interactive Marketing Dashboard",
x = "Customer Volume",
y = "Revenue Collected"
)
ggplotly(interactive_plot)
This project analyzed: - campaign effectiveness, - customer engagement, - estimated CTR, - ROI-related metrics, - and customer response behavior.
The dashboard demonstrates: - business intelligence, - marketing analytics, - customer segmentation, - interactive visualization, - and storytelling with data.
The visualizations support: - campaign optimization, - customer targeting, - and data-driven marketing decision-making.