Customer Journey Analysis
Parag Verma
10th Jan, 2022
Introduction
Customers are the single most important entity in any value chain.Everything and anything under the sun is designed to please customer so that they buy products,use medicines/drugs and what not. They are the ones who actually move the needle and hence it is important to understand what is their different touchpoints with the external stimulus.In other words, how exactly they move in their lets say shopping experience helps companies fine tune the touchpoints to better identify selling opportunities.In this blog, we will take a small dummy example to understand how different customers go through the marketing campaigns driven by a company
We will be using ggplot2 and ggalluvial libraries to create the journey plots or the Sankey Charts
package.name<-c("dplyr","ggplot2","ggalluvial")
for(i in package.name){
if(!require(i,character.only = T)){
install.packages(i)
}
library(i,character.only = T)
}
Creating the Data Set
This is a sample data of 20 customers and how various marketing channels are used to target it
set.seed(42)
individual <- as.character(rep(1:20,each=5))
timeperiod <- paste0(rep(c(0, 18,36,54,72),20),"_week")
Type <- factor(sample(c("Email", "Freebees", "Coupon", "Freebees","Vouchers"), 100, replace=T))
d <- data.frame(individual, timeperiod, Type)
head(d)
individual timeperiod Type
1 1 0_week Email
2 1 18_week Vouchers
3 1 36_week Email
4 1 54_week Email
5 1 72_week Freebees
6 2 0_week Freebees
- There are 20 customers in this data
- Each customer is targeted in 0,18,36,54 and 72nd
- Email,Vouchers,Freebees and Coupons are the channels used to target customers
Creating the Journey Plot
ggplot(d, aes(x = timeperiod, stratum = Type, alluvium = individual, fill = Type, label = Type)) +
scale_fill_brewer(type = "qual", palette = "Set2") +
geom_flow(color = "darkgray") +
geom_stratum() +
theme(legend.position = "bottom") +
ggtitle("Channels across observation period")
Warning: The `.dots` argument of `group_by()` is deprecated as of dplyr 1.0.0.
Final Note
We saw how a simple Sankey chart can be used to understand thow external stimulus impacts a customers journey.In the next blog we will look at plotly library and how we can leverage the hovering functionality of the package to create enhanced user experience