The Email Metrics Dashboard is a powerful Streamlit application designed to analyze and visualize email campaign performance data. This interactive dashboard helps marketers and business professionals gain insights into email engagement metrics such as open rates, click rates, and overall engagement across different companies and job roles.
- Comprehensive Metrics: Track open rates, click rates, click-to-open rates (CTOR), and custom engagement scores
- Interactive Filtering: Filter data by company, job role, and metric type
- Visual Analytics: View performance through dynamic bar charts and correlation analyses
- Detailed Breakdowns: See engagement metrics by company and job role
- Simulation Tools: Project future campaign performance based on current metrics
- Data Export: Export your analysis as CSV for further processing
- Industry Benchmarks: Compare your performance against industry standards
- Personalized Insights: Get actionable recommendations based on your data
- Python 3.7 or higher
- Streamlit
- Pandas
- NumPy
- Plotly
-
Clone the repository:
git clone https://github.com/NullIsMySoul/Email_Stats.git cd Email_Stats -
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run streamlit_app.py
Your CSV file should include the following columns:
| Column Name | Description | Example Values |
|---|---|---|
| Company | Name of the recipient's company | "Acme Corp", "TechGiant" |
| JobRole | Job title or role of the recipient | "CEO", "Marketing Director" |
| PersonName | Name of the recipient | "John Smith", "Jane Doe" |
| EmailsSent | Whether an email was sent | "yes", "no", 1, 0 |
| EmailsOpened | Whether the email was opened | "yes", "no", 1, 0 |
| EmailsClicked | Whether the email was clicked | "yes", "no", 1, 0 |
- Upload CSV: Click the "Browse files" button in the sidebar to upload your CSV data
- Sample Data: Alternatively, click "Load Sample Data" to explore the dashboard with demo data
- Filters: Use the dropdown menus at the top to filter by company, job role, or metric type
- Summary Metrics: View key performance indicators at the top of the dashboard
- Performance Analysis: Toggle between bar charts and data tables to analyze your data
- Insights & Recommendations: Expand this section to see personalized insights based on your data
- Advanced Analytics: Explore correlation patterns and run future campaign simulations
- Data Export: Download your filtered data as a CSV file for further analysis
- Open Rate: Percentage of sent emails that were opened
- Click Rate: Percentage of sent emails that had at least one click
- Click-to-Open Rate (CTOR): Percentage of opened emails that were clicked
- Engagement Score: A weighted metric combining open rate (40%) and click rate (60%)
The application is contained in a single Python file with the following components:
- Page Configuration: Sets up the Streamlit interface
- Custom CSS: Provides styling for the dashboard elements
- Helper Functions: Process data and calculate metrics
- Data Loading: Handles CSV upload and sample data creation
- Data Processing: Converts and calculates metrics from raw data
- Visualization Components: Creates charts and interactive elements
- Insights Generation: Produces recommendations based on the data
- Advanced Analytics: Creates correlation charts and simulations
convert_binary_data(df): Converts yes/no values to 1/0 for metrics columnscalculate_metrics(df): Calculates open rates, click rates, and engagement scoresgenerate_industry_benchmarks(): Provides comparison benchmarkscreate_sample_data(): Generates demo data for the dashboard
To add a new metric, modify the calculate_metrics() function:
def calculate_metrics(df):
# Existing code...
# Add your new metric calculation
result_df['NewMetric'] = np.where(condition,
calculation_if_true,
calculation_if_false)
return result_dfThe dashboard uses Streamlit components and custom CSS. To modify the UI:
- Update the CSS in the
st.markdown("""<style>...""")section - Modify the layout using Streamlit's column system:
col1, col2 = st.columns(2) - Add new visualization sections using tabs:
tab1, tab2 = st.tabs(["Tab1", "Tab2"])
To add a new chart:
# Create a new figure
fig = go.Figure(go.Bar(
x=data['x_values'],
y=data['y_values'],
text=[f"{val:.1f}%" for val in data['y_values']],
textposition='outside',
marker_color='rgba(74, 111, 255, 0.7)'
))
# Configure layout
fig.update_layout(
title='Chart Title',
xaxis_title='X-Axis Label',
yaxis_title='Y-Axis Label',
height=400
)
# Display the chart
st.plotly_chart(fig, use_container_width=True)- CSV Format Errors: Ensure your CSV has all required columns with correct names
- Data Type Errors: The application will try to convert text values like "yes"/"no" to binary, but consistent formatting is recommended
- Empty Charts: Check if your filters have removed all relevant data points
- Performance Issues: For very large datasets, consider pre-aggregating your data
For issues or feature requests, please open an issue on the GitHub repository or contact the development team.
