Predicting Online Shopping Behavior Through Clickstream
Analysis
M.Anitha1, [Link] Ramya2,MD.Zeenath3
#1 Assistant Professor & Head of Department of MCA, SRK Institute of Technology, Vijayawada.
#2 Assistant Professor in the Department of MCA, SRK Institute of Technology, Vijayawada.
#3 Student in the Department of MCA, SRK Institute of Technology, Vijayawada
ABSTRACT - This project revolves around the exploration and analysis of clickstream data
related to online shopping, aiming to gain insights into user behavior and preferences. The
dataset, obtained from the "Clickstream Data for Online Shopping" repository on the UCI
Machine Learning Repository, encompasses a wealth of information on user interactions
during online shopping sessions. The dataset includes details such as user session timestamps,
pages visited, duration of visits, and specific actions taken (e.g., clicks, adding items to the
cart). Our objective is to leverage machine learning techniques to uncover patterns in the
clickstream data that can aid in predicting user behavior, such as whether a user will make a
purchase or abandon their shopping cart. We plan to employ classification algorithms to build
predictive models capable of identifying potential purchase intent based on the sequence and
frequency of user interactions. The outcomes of this analysis can assist online retailers in
optimizing their platforms, enhancing user experiences, and implementing targeted marketing
strategies to increase conversion rates and overall customer satisfaction. In the contemporary
landscape of commerce, the digital realm has undergone a paradigm shift with the
proliferation of online shopping platforms. This transformation has fundamentally altered
consumer behavior, empowering individuals with unparalleled access to a vast array of
products and services at their fingertips. As consumers navigate through the digital
marketplace, their interactions leave behind a trail of data known as clickstream data. This
dataset encapsulates the sequence of user engagements during online browsing and
purchasing sessions, offering invaluable insights into consumer behavior patterns.
[Link] provides a comprehensive record of user
engagement with e-commerce platforms,
Clickstream data encompasses a plethora serving as a treasure trove for businesses
of information, ranging from the pages seeking to unravel the mysteries of
visited and the duration of visits to specific consumer preferences and purchasing
actions taken, such as clicks and items decisions. By delving into clickstream
added to the cart. This rich tapestry of data data, businesses can gain a nuanced
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 20
understanding of user behaviors, enabling machine learning algorithms to analyze the
them to optimize their platforms, tailor clickstream data and derive predictive
marketing strategies, and enhance the models of user behavior. Classification
overall user experience. algorithms, renowned for their ability to
At the heart of this project lies a dataset categorize data into distinct classes, serve
sourced from the "Clickstream Data for as the cornerstone of our analytical
Online Shopping" repository on the UCI framework. By training these algorithms
Machine Learning Repository. This dataset on the clickstream dataset, we aim to
serves as the cornerstone of our discern underlying patterns and trends that
exploration, offering a robust foundation can inform predictive models of user
for uncovering hidden patterns and trends behavior.
in user behavior. With timestamps, page
visits, duration of visits, and specific The first step in our approach involves
actions taken meticulously recorded, this preprocessing the clickstream data to
dataset presents a wealth of opportunities ensure its quality and suitability for
for leveraging machine learning machine learning analysis. This entails
techniques to extract actionable insights. handling missing values, normalizing
features, and addressing any temporal
The overarching objective of this project is dependencies present in the dataset. Once
to harness the power of machine learning to the data preprocessing is complete, we
distill actionable insights from clickstream proceed to implement various classification
data related to online shopping. algorithms, including but not limited to
Specifically, we aim to develop predictive logistic regression, decision trees, random
models capable of discerning user forests, and support vector machine.
behavior patterns, such as purchase intent
and cart abandonment. By employing Feature engineering plays a pivotal role in
classification algorithms, we seek to enhancing the predictive power of our
identify potential customers who are likely models. By extracting relevant features
to make a purchase and those who may from the raw clickstream data and crafting
abandon their shopping carts, thereby new features that capture the essence of
enabling businesses to tailor their user behavior, we aim to enrich the feature
strategies and interventions accordingly space and improve the overall performance
of our predictive models. Techniques such
Our approach hinges on the utilization of
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 21
as polynomial feature expansion, and implications of previous studies, we
interaction terms, and dimensionality aim to inform the objectives and approach
reduction enable us to uncover hidden of our own research project focused on
patterns and relationships within the data. leveraging machine learning techniques to
Interpretability represents a key predict user behavior and optimize online
consideration in our analysis, as we strive shopping experiences.
to ensure that our predictive models are not 1. Understanding User Behavior:
only accurate but also transparent and
interpretable. Techniques such as partial Numerous studies have investigated user
dependence plots, permutation feature behavior in online shopping environments
importance, and SHAP (Shapley Additive through the analysis of clickstream data.
exPlanations) values allow us to elucidate For example, research by Jansen et al.
the factors driving our models' predictions (2017) examined the factors influencing
and gain insights into the underlying user engagement and conversion rates in e-
mechanisms of user behavior. commerce websites. By analyzing
[Link] SURVEY clickstream data, the study identified key
The proliferation of online shopping predictors of conversion, such as session
platforms has transformed the retail duration, page views, and interaction
landscape, offering consumers patterns. Similarly, Liu et al. (2018)
unparalleled convenience and explored the impact of website design on
accessibility. However, with this shift user engagement and purchase behavior,
towards digital commerce comes the highlighting the importance of factors such
challenge of understanding and predicting as layout, navigation, and visual appeal in
user behavior in the online environment. driving conversion rates.
Clickstream data, which captures user
interactions with websites, presents a 2. Predictive Modeling and
valuable source of information for gaining Personalization:
insights into user preferences, decision-
making processes, and purchasing The use of predictive modeling techniques
patterns. In this literature survey, we has emerged as a promising approach for
explore existing research and scholarly predicting user behavior in online
contributions related to clickstream data shopping environments. Chen et al. (2019)
analysis in the context of online shopping. developed a predictive model based on
By examining the methodologies, findings,
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 22
clickstream data to forecast user purchase unexpected costs, complex checkout
intent and personalize product processes, and lack of trust. The study
recommendations. By analyzing user proposed interventions, such as
interactions and historical purchase personalized retargeting campaigns and
data, the model achieved high accuracy streamlined checkout experiences, to
in predicting user behavior and tailoring reduce cart abandonment rates and
recommendations to individual improve conversion rates.
preferences. Similarly, Wang et al. (2020) [Link] SYSTEM
employed machine learning algorithms to The proposed system aims to overcome
predict user click-through rates and the limitations of the existing clickstream
optimize marketing campaigns, data analysis in online shopping by
demonstrating the efficacy of predictive leveraging advanced machine learning
modeling in enhancing user engagement techniques and integrated analytics
and conversion rates. frameworks. In this system, we propose
the development of a comprehensive
3. Cart Abandonment and analytics platform that integrates multiple
Conversion Optimization: data sources, including clickstream data,
Cart abandonment remains a significant customer demographic information,
challenge for online retailers, resulting in purchase history, and real-time contextual
lost revenue and missed opportunities. data.
Research has focused on understanding the By aggregating and harmonizing these
underlying factors contributing to cart diverse data streams, retailers can gain a
abandonment and strategies for conversion holistic understanding of user behavior and
optimization. Li et al. (2021) analyzed preferences, enabling more accurate
clickstream data to identify common prediction and personalized targeting
reasons for cart abandonment, such as
[Link] AND DISCUSSION
This visualization provides insights into the distribution of product prices across different
color categories. By examining the bar chart, one can identify which colors tend to have
higher total prices and understand the overall pricing dynamics based on color preferences.
Additionally, the customization applied to the plot ensures that the information presented is
clear and easy to interpret.
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 23
Visualizing Average Daily Prices by Country
Figure 1: Average Daily Prices by Country
1. Data Aggregation: prices. The `reset_index()` function is then
used to reset the index of the resulting
`df_sum = DataFrame.
[Link](by=["country",'day'])[['price']].su
`df` by the columns "country" and "day" - `count =
and calculates the sum of prices for each
group. The `[['price']].sum()` part specifies 2. Sorting:
that we are only interested in the sum of
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 24
- `df_sum = =df_sum.sort_values(['avreage
df_sum.sort_values(['price'], _prices'], ascending=False)`: The
ascending=False)`: After calculating the `df_sum` DataFrame is then sorted again,
sum of prices for each country-day this time based on the calculated average
combination, this line sorts the DataFrame prices in descending order. This sorting
`df_sum` in descending order based on the helps identify countries with the highest
"price" column. This sorting is done to average prices per transaction.
identify countries with the highest total
prices. 5. Visualization:
- `count = - `fig =
count.sort_values(['price'], [Link](df_sum,
ascending=False)`: Similarly, the count x=df_sum["country"],
DataFrame is sorted in descending order y=df_sum["day"],color=df_sum['avreag
based on the "price" column to identify e_prices'],size=df_sum['avrea
countries with the highest number of ge_prices'])`: Using Plotly Express (`px`),
transactions. a scatter plot is created with countries on
the x-axis, days on the y-axis, and average
3. Calculating Average Prices: prices represented by both color and size
of the data points. Each data point
- `df_sum['avreage_prices'] =
represents a country-day combination,
df_sum['price']/count['price']`: Thisline
with the color and size indicating the
computes the average prices by dividing
average price.
the total prices (from
`df_sum`) by the corresponding counts
6. Displaying the Plot:
(from
`count`). The result is stored in a new
- [Link]()`: Finally, the
column named "average_prices" inthe
scatter plot is displayed. The plot provides
`df_sum` DataFrame.
a visual representation of the average
prices across different countries and days,
4. Sorting by Average Prices:
allowing for easy comparison and
- `df_sum identification of trends.
Correlation Matrix
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 25
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 26
- `[Link](corr_matrix,
1. DataFrame Preparation : vmin=0, vmax=1, annot=True, fmt='.2f',
cmap="YlGnBu", cbar=True,
- `df_copy2 = [Link](['price','price
linewidths=0.5)`: Using Seaborn's
2'], axis=1)`: This line creates a new
`heatmap()` function, this line creates a
DataFrame
heatmap to visualize the correlation matrix.
`df_copy2` by dropping the columns
Parameters like `vmin` and `vmax` set the
"price" and "price 2" from the original
range of values to be mapped to the
DataFrame `df`. The `drop()` function
colormap, `annot=True` displays the
removes the specified columns along the
correlation coefficients as annotations in
specified axis (1 indicates columns) and
the heatmap, `fmt='.2f'` specifies the
returns a new DataFrame with the
format of the annotations to two decimal
remaining columns.
places, `cmap="YlGnBu"` sets the color
map,
2. Correlation Analysis : `cbar=True` shows the color bar
- `corr_matrix = indicating the correlation scale, and
df_copy2.corr(method="pearson")`: This `linewidths=0.5` determines the width of
line calculates the Pearson correlation the lines between cells.
coefficients between all pairs of numeric
- `[Link]("pearson correlation")`:
columns in the DataFrame `df_copy2`.
This line sets the title of the heatmap as
"pearson correlation".
The `corr()` function with the method
parameter set to "pearson" computes the
Pearson correlation matrix, which
[Link]
measures the linear correlation between
variables. It returns a DataFrame where In conclusion, this dissertation has
each cell represents the correlation explored various aspects of e-commerce
coefficient between two variables. behavior and trends using a dataset from
an online clothing store. Through
3. Visualization : comprehensive data analysis and
visualization, several key insights have
- `[Link](figsize=(10,6))`: This
been uncovered, shedding light on
line initializes a new Matplotlib figure with
customer preferences, purchasing patterns,
a specific size for plotting the heatmap.
and the effectiveness of certain marketing
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 27
strategies. impact of marketing strategies, such as
model photography placement and product
1. Customer Behavior and pricing, on sales and customer engagement.
Preferences: By analyzing click-through rates, product
pricing status, and the influence of model
The analysis revealed insights into
photography, valuable insights were
customer behavior, such as the most
gained into effective marketing tactics for
visited countries and the flexibility of
driving sales and customer engagement.
purchasing among different demographics.
It was observed that countries like Poland
4. Data Preprocessing and Model
and the Czech Republic showed high
Training:
flexibility in purchasing behavior, while
others exhibited varying trends based on Additionally, the dissertation delved into
factors like language and product data preprocessing techniques, such as
availability. label encoding and handling missing
values, to prepare the dataset for machine
2. Sales Trends and Product learning model training. Various
Performance: classification and regression models were
trained and evaluated to predict product
Examination of sales data highlighted
pricing status and sales performance,
trends in product performance and sales
providing actionable insights for pricing
across different categories and months. For
strategies and revenue optimization.
example, trousers emerged as the top-
selling category, with April and May being
5. Implications and
the peak selling months. Furthermore, the
Recommendations:
analysis identified correlations between
product categories, colors, and sales The findings from this dissertation have
performance, providing valuable insights practical implications for e- commerce
for inventory management and marketing businesses seeking to enhance their
strategies. marketing strategies, optimize product
pricing, and improve customer
3. Effectiveness of Marketing engagement. Recommendations include
Strategies: leveraging insights from customer
behavior analysis to tailor marketing
The dissertation also investigated the campaigns, optimizing product placement
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 28
and pricing based on sales trends, and practice. Pearson UK.
investing in predictive analytics to forecast
future sales and demand. 2. Laudon, K. C., & Traver, C. G.
(2016). E-commerce 2016:Business,
6. Future Research Directions: technology, society. Pearson.
While this dissertation has provided
valuable insights into e-commerce 3. Turban, E., King, D., Lee, J. K.,
behavior and trends, there are several Liang, T. P., & Turban, D. C. (2019).
avenues for future research. Future studies Electronic commerce 2018: A managerial
could explore the impact of external and social networks perspective. Springer.
factors such as economic conditions and
global events on e-commerce sales, 4. Kalakota, R., & Whinston, A. B.
investigate the effectiveness of (1996). Frontiers of electronic commerce.
personalized marketing strategies, and Pearson Education India.
further refine machine learning models to
improve predictive accuracy. 5. O’Brien, J. A., & Marakas, G. M.
(2018). Managementinformation systems.
In conclusion, this dissertation serves as a McGraw-Hill Education.
comprehensive exploration of e- commerce
behavior and trends, providing valuable 6. Rayport, J. F., & Jaworski, B. J.
insights and actionable recommendations (2004). Introduction to e-commerce.
for businesses operating in the online retail McGraw-Hill.
sector. By leveraging data-driven
approaches and advanced analytics 7. Sengupta, S. (2016).
techniques, businesses can gain a Information management and
competitive edge and drive growth in an Learning Pvt. Ltd.
increasinglydigital marketplace
References
8. Rogers, E. M. (2010). Diffusion of
innovations. Simon and Schuster.
Vanhoof, K., & Van Hove, L. (2014).
1. Chaffey, D., Ellis-Chadwick, F.,
Business-to-business marketing
Johnston, K., & Mayer, R. (2019). Digital
communication: Value and
marketing: Strategy, implementation and
efficiency considerations
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 29
AUTHOR’S PROFILES
[Link] Working as Assistant [Link] Ramya completed her Master
Professor & Head of Department of MCA of Computer Applications. Currently
,in SRK Institute of technology in working as an Assistant Professor in the
Vijayawada. She done with [Link], MCA department of MCA at SRK Institute Of
,M. Tech in Computer Science .She has 14 Technology, Enikepadu, Vijayawada, NTR
years of Teaching experience in SRK District. Her area of interest includes
Institute of Technology. Enikepadu, Networks, Machine Learning.
Vijayawada, NTR District. Her area of
interest includes Machine Learning with
Python and DBMS.
[Link] is an MCA Student in the
Department of Computer Application at
SRK Institute Of Technology, Enikepadu,
Vijayawada, NTR District. She has
Completed Degree in [Link].(computers)
from Sri Durga Malleswara Siddhartha
Mahila Kalasala at MG road. Her area of
interest are Python and Machine Learning.
Volume 14, Issue 05, May 2024 ISSN 2457-0362 Page 30