Sunday, January 9, 2022

Customer Journey Analysis using R-Part 1

Customer Journey Analysis


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

My Youtube Channel

8 comments:

  1. 888sport Casino Review & Bonus - DrMCD
    888Sport Casino is operated by 시흥 출장샵 Betsoft Solutions and is 과천 출장마사지 licensed by the Malta 김포 출장샵 Gaming Authority 경주 출장마사지 under the 경상남도 출장샵 Gaming Control (GCCG) Code of Malta. 888Sport Casino

    ReplyDelete
    Replies
    1. Understanding customer journeys is essential for identifying how people interact with marketing campaigns at different stages of their shopping experience. The use of ggplot2 and ggalluvial to create Sankey-style journey plots is particularly interesting because it helps visualize how customers move between touchpoints and where engagement patterns may reveal opportunities for improving campaign effectiveness.

      These visualizations become more meaningful when combined with the analytical techniques covered in a Data Analysis Course, where identifying patterns and interpreting customer behavior are important parts of turning raw data into actionable insights.

      Delete
    2. A Data Visualization Course can also help learners understand how to present these customer flows clearly, making it easier to communicate transitions between campaign stages and compare different journey patterns. The combination of customer analytics and flow-based visualization offers a practical way to explore marketing performance.

      Delete
    3. Customer journey analysis using Sankey charts offers a useful way to understand how customers move through different marketing touchpoints and identify patterns in their engagement. When these journey patterns are analyzed systematically, they can provide insights into campaign performance, customer behavior, and opportunities to improve marketing decisions.

      The same analytical approach can be extended to Machine Learning Projects for Final Year, where models can help identify customer segments, predict responses, and uncover patterns in campaign interactions. Combining visualization with predictive analysis can make customer data more informative.

      Delete
    4. Similarly, Data Science Projects for Final Year can explore how data preparation, behavioral analysis, and visual storytelling work together to interpret customer journeys. This makes the topic a practical example of turning raw interaction data into insights that support better business decisions.

      Delete
  2. "If your car is making a clicking noise when you turn, it could indicate a problem with your CV joints." pre purchase inspection

    ReplyDelete
  3. IsraFace - израильтяне, это еврейская соцсеть, где зарегистрированы евреи и еврейки и русский еврей из США, Белоруссии. Загружайте классные кадры, видосики, объединяйтесь в сообщества, ведите блог, навещайте форум, начинайте еврейские знакомства.

    ReplyDelete
  4. продвижение внешними ссылками как добавить внешнюю ссылку в вк

    ReplyDelete

Price Elasticity Model in Python

Price Elasticity Analysis in Python Introduction ¶ In this blog we will look at how to find the price e...