A comprehensive customer segmentation and marketing automation system for mall retailers.
- Customer Segmentation: Automatically categorize customers into segments (VIP, Regular, At-Risk, New, etc.) based on purchase patterns
- Interactive Dashboard: Visualize key business metrics and customer insights
- Automated Email Marketing: Send targeted emails to customers based on their segment and purchase history
- Email Campaign Tracking: Track email opens and clicks to measure campaign effectiveness
- Product Recommendations: Suggest products to customers based on their previous purchases
- Offer Management: Create and manage special offers for different customer segments
app.py: Main Streamlit application entry pointpages/: Contains all the pages for the multi-page Streamlit appsrc/: Source code for data processing, segmentation, and email functionalitymodels/: Trained machine learning models for customer segmentationutils/: Utility functions used across the applicationdata/: Data files (processed versions of the original dataset)config/: Configuration files for the applicationtest_data/: Test customer data for email functionality testing
- Clone this repository
- Install the required packages:
pip install -r requirements.txt - Run the application:
streamlit run app.py
The system includes a built-in email configuration system that supports:
- Gmail (recommended to use with SSL on port 465)
- Outlook
- Yahoo Mail
- Custom SMTP providers
To set up email for the first time:
- Navigate to the "Test Email" page
- Select your email provider
- Enter your credentials:
- For Gmail: Use your Gmail address and an App Password (requires 2-Step Verification)
- For other providers: Use your email address and password
- Save the configuration, which will be stored in a
.envfile
- Test Email Page: Send test emails to verify your configuration and template designs
- Email Marketing Page: Create and send targeted campaigns to specific customer segments
- Email Template Management: Create and customize email templates for different campaigns
- Email Tracking: Track email opens and clicks to measure campaign effectiveness
- Campaign Analytics: View campaign results and engagement metrics
If using Gmail:
- Enable 2-Step Verification in your Google Account security settings
- Generate an App Password for the application
- Use SSL (port 465) for the most reliable connection
- Enter the App Password without spaces
- Upload your customer data or use the provided sample data
- Navigate through the different pages to explore insights and manage customer segments
- Set up email configuration in the "Test Email" page
- Test email functionality with a single customer
- Create targeted email campaigns based on customer segments
- Monitor campaign results and customer engagement
MIT