DEV Community

Cover image for Customer Shopping Behavior Analysis: Driving Retail Insights with Data
Gatusso
Gatusso

Posted on

Customer Shopping Behavior Analysis: Driving Retail Insights with Data

I recently completed an end-to-end Customer Shopping Behavior Analysis project using a dataset of 3,900 transactions. The objective was to uncover actionable insights into spending patterns, customer segments, product preferences, and subscription behavior to support strategic business decisions.

Project Approach

  1. Data Preparation & Cleaning (Python)
  • Loaded and explored the dataset using pandas.

Dataset

  • Handled 37 missing values in the Review Rating column by imputing with category-specific medians.

Replacing the nulls with median

  • Standardized column names to snake_case, performed consistency checks, and dropped redundant features (e.g., promo_code_used was identical to discount_applied).

  • Created new features: age_group and purchase_frequency_days (converted textual frequency into numeric days).

  • Loaded the cleaned data into PostgreSQL for efficient querying.

Loading the dataset to Postgres

  1. SQL Analysis – Answering Key Business Questions I developed structured SQL queries in PostgreSQL to deliver clear business insights, including:
  • Revenue split by gender (Males: ~$157K vs. Females: ~$75K).

Revenue by Gender

  • High-spending customers who used discounts.

High Spending with Discounts

  • Top 5-rated products per ratings.

Top 5 products by rating

  • Shipping type performance (Express vs. Standard).

Shipping type

  • Subscribers vs. non-subscribers comparison.

Subscribers vs non-subscribers

  • Discount dependency by product.

Discount dependency by product

  • Customer segmentation (New, Returning, Loyal) based on purchase history.

Customer Segmentation

  • Revenue contribution by age group.

Revenue by Age-Group

  1. Visualization & Storytelling Built an interactive Power BI dashboard featuring key KPIs, revenue breakdowns by category/age/subscription, sales trends, and filters for dynamic exploration.

Dashboard

Key Business Recommendations

  1. Strengthen subscription programs with exclusive benefits to convert more loyal customers.

  2. Implement targeted loyalty programs to grow the β€œLoyal” segment (currently 80% of customers).

  3. Review discount strategy on high-dependency items (e.g., Hats, Sneakers) to protect margins.

  4. Focus marketing on high-revenue age groups and customers preferring Express shipping.

Top comments (0)