-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkpi_dashboard.html
More file actions
221 lines (199 loc) · 9.65 KB
/
kpi_dashboard.html
File metadata and controls
221 lines (199 loc) · 9.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>User Funnel & KPI Performance Dashboard</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js"></script>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Arial,sans-serif;background:#f0f4f8;color:#1a202c}
header{background:linear-gradient(135deg,#1F4E79,#2E86C1);color:#fff;padding:24px 32px}
header h1{font-size:22px;font-weight:700;margin-bottom:4px}
header p{font-size:13px;opacity:.85}
.badges{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}
.badge{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.35);border-radius:20px;padding:3px 12px;font-size:12px;font-weight:600}
.container{max-width:1200px;margin:0 auto;padding:24px 16px}
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:28px}
.kpi-card{background:#fff;border-radius:10px;padding:16px;text-align:center;border-top:4px solid #2E86C1;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.kpi-label{font-size:12px;color:#718096;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}
.kpi-value{font-size:26px;font-weight:700;color:#1F4E79}
.kpi-sub{font-size:11px;color:#a0aec0;margin-top:3px}
.charts-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(480px,1fr));gap:20px;margin-bottom:20px}
.chart-card{background:#fff;border-radius:10px;padding:20px;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.chart-title{font-size:14px;font-weight:700;color:#1F4E79;margin-bottom:14px;padding-bottom:8px;border-bottom:2px solid #EBF5FB}
.chart-wrap{position:relative;width:100%}
.insight{background:#EBF5FB;border-left:4px solid #2E86C1;border-radius:6px;padding:10px 14px;margin-top:14px;font-size:12px;color:#1F4E79;line-height:1.6}
.insight strong{display:block;margin-bottom:2px}
.stage-table{width:100%;border-collapse:collapse;font-size:13px}
.stage-table th{background:#1F4E79;color:#fff;padding:9px 12px;text-align:left;font-weight:600}
.stage-table td{padding:9px 12px;border-bottom:1px solid #EDF2F7}
.stage-table tr:hover td{background:#EBF5FB}
.drop-warn{color:#c0392b;font-weight:700}
.drop-ok{color:#27ae60;font-weight:600}
.bar-inline{display:inline-block;height:10px;border-radius:5px;margin-right:6px;vertical-align:middle}
footer{text-align:center;padding:20px;font-size:12px;color:#a0aec0;margin-top:10px}
</style>
</head>
<body>
<header>
<h1>📊 User Funnel & KPI Performance Analysis</h1>
<p>Analyzed 4,715 user activity records across 5 funnel stages | January – March 2024</p>
<div class="badges">
<span class="badge">SQL · MySQL</span>
<span class="badge">4,715 Records</span>
<span class="badge">1,800 Users</span>
<span class="badge">5 Funnel Stages</span>
<span class="badge">10 Products</span>
</div>
</header>
<div class="container">
<!-- KPI Cards -->
<div class="kpi-grid">
<div class="kpi-card"><div class="kpi-label">Total Users</div><div class="kpi-value">1,800</div><div class="kpi-sub">unique users</div></div>
<div class="kpi-card"><div class="kpi-label">Total Events</div><div class="kpi-value">4,715</div><div class="kpi-sub">activity records</div></div>
<div class="kpi-card"><div class="kpi-label">Overall Conversion</div><div class="kpi-value">35.0%</div><div class="kpi-sub">visit → purchase</div></div>
<div class="kpi-card"><div class="kpi-label">Avg Session</div><div class="kpi-value">456s</div><div class="kpi-sub">avg duration</div></div>
<div class="kpi-card"><div class="kpi-label">Avg Page Views</div><div class="kpi-value">7.9</div><div class="kpi-sub">per session</div></div>
<div class="kpi-card" style="border-top-color:#27ae60"><div class="kpi-label">Returning Users</div><div class="kpi-value">49.8%</div><div class="kpi-sub">of all users</div></div>
</div>
<!-- Funnel + Conversion -->
<div class="charts-grid">
<div class="chart-card">
<div class="chart-title">🔻 Funnel Drop-off Analysis</div>
<table class="stage-table">
<thead><tr><th>Stage</th><th>Users</th><th>Drop-off</th><th>Volume</th></tr></thead>
<tbody>
<tr><td>Visit</td><td>1,800</td><td>—</td><td><span class="bar-inline" style="width:140px;background:#2E86C1"></span></td></tr>
<tr><td>Signup</td><td>1,441</td><td class="drop-ok">↓ 19.9%</td><td><span class="bar-inline" style="width:112px;background:#27ae60"></span></td></tr>
<tr><td>Add to Cart</td><td>1,134</td><td class="drop-ok">↓ 21.3%</td><td><span class="bar-inline" style="width:88px;background:#f39c12"></span></td></tr>
<tr><td>Checkout</td><td>828</td><td class="drop-warn">↓ 27.0% ⚠</td><td><span class="bar-inline" style="width:64px;background:#e67e22"></span></td></tr>
<tr><td>Purchase</td><td>630</td><td class="drop-warn">↓ 23.9%</td><td><span class="bar-inline" style="width:49px;background:#c0392b"></span></td></tr>
</tbody>
</table>
<div class="insight"><strong>⚠ Key Insight</strong>Biggest drop-off occurs at Add to Cart → Checkout (27.0%). This is the primary optimization target — possible causes: unexpected costs, long forms, or payment friction.</div>
</div>
<div class="chart-card">
<div class="chart-title">🎯 Step-to-Step Conversion Rates</div>
<div class="chart-wrap" style="height:260px"><canvas id="convChart"></canvas></div>
<div class="insight"><strong>✅ Best Step</strong>Signup → Add to Cart conversion is strongest at 78.7%. Visit → Signup at 80.1% also performs well, showing effective onboarding.</div>
</div>
</div>
<div class="charts-grid">
<div class="chart-card">
<div class="chart-title">🏆 Product Interactions (Top 10)</div>
<div class="chart-wrap" style="height:320px"><canvas id="productChart"></canvas></div>
</div>
<div class="chart-card">
<div class="chart-title">📱 Users by Device Type</div>
<div class="chart-wrap" style="height:320px"><canvas id="deviceChart"></canvas></div>
<div class="insight"><strong>📱 Mobile Dominant</strong>Mobile accounts for the largest user share. Optimizing the checkout flow for mobile could directly address the highest drop-off stage.</div>
</div>
</div>
<div class="charts-grid">
<div class="chart-card">
<div class="chart-title">🌍 Funnel Completion by Region</div>
<div class="chart-wrap" style="height:280px"><canvas id="regionChart"></canvas></div>
</div>
<div class="chart-card">
<div class="chart-title">👥 Users by Age Group</div>
<div class="chart-wrap" style="height:280px"><canvas id="ageChart"></canvas></div>
<div class="insight"><strong>🎯 Core Segment</strong>The 25–34 age group is the most active cohort. Tailoring checkout UX and offers for this segment can improve overall conversion.</div>
</div>
</div>
</div>
<footer>Built by <strong>Gauri Sharan</strong> · User Funnel & KPI Performance Analysis · SQL + HTML/Chart.js</footer>
<script>
const convCtx = document.getElementById('convChart').getContext('2d');
new Chart(convCtx,{
type:'bar',
data:{
labels:['Visit→Signup','Signup→Cart','Cart→Checkout','Checkout→Purchase','Overall'],
datasets:[{
label:'Conversion %',
data:[80.1,78.7,73.0,76.1,35.0],
backgroundColor:['#27ae60','#2ecc71','#e74c3c','#e67e22','#1F4E79'],
borderRadius:6
}]
},
options:{
responsive:true,maintainAspectRatio:false,
plugins:{legend:{display:false}},
scales:{
y:{beginAtZero:true,max:100,ticks:{callback:v=>v+'%'}},
x:{ticks:{font:{size:11}}}
}
}
});
const productCtx = document.getElementById('productChart').getContext('2d');
new Chart(productCtx,{
type:'bar',
data:{
labels:['P1','P2','P3','P4','P5','P6','P7','P8','P9','P10'],
datasets:[{
label:'Interactions',
data:[498,482,476,473,470,468,464,460,457,447],
backgroundColor:'#2E86C1',
borderRadius:4
}]
},
options:{
indexAxis:'y',
responsive:true,maintainAspectRatio:false,
plugins:{legend:{display:false}},
scales:{x:{beginAtZero:true},y:{ticks:{font:{size:12}}}}
}
});
const deviceCtx = document.getElementById('deviceChart').getContext('2d');
new Chart(deviceCtx,{
type:'doughnut',
data:{
labels:['Mobile','Desktop','Tablet'],
datasets:[{
data:[42,38,20],
backgroundColor:['#2E86C1','#27ae60','#f39c12'],
borderWidth:2,borderColor:'#fff'
}]
},
options:{
responsive:true,maintainAspectRatio:false,
plugins:{legend:{position:'bottom',labels:{padding:16,font:{size:12}}}}
}
});
const regionCtx = document.getElementById('regionChart').getContext('2d');
new Chart(regionCtx,{
type:'bar',
data:{
labels:['North','South','East','West','Central'],
datasets:[
{label:'Visits',data:[370,352,348,366,364],backgroundColor:'#85B7EB',borderRadius:4},
{label:'Purchases',data:[132,121,118,130,129],backgroundColor:'#1F4E79',borderRadius:4}
]
},
options:{
responsive:true,maintainAspectRatio:false,
plugins:{legend:{position:'bottom'}},
scales:{x:{ticks:{font:{size:12}}},y:{beginAtZero:true}}
}
});
const ageCtx = document.getElementById('ageChart').getContext('2d');
new Chart(ageCtx,{
type:'bar',
data:{
labels:['18-24','25-34','35-44','45-54','55+'],
datasets:[{
label:'Users',
data:[342,418,371,346,323],
backgroundColor:['#5DADE2','#2E86C1','#1A5276','#1F4E79','#85C1E9'],
borderRadius:6
}]
},
options:{
responsive:true,maintainAspectRatio:false,
plugins:{legend:{display:false}},
scales:{x:{ticks:{font:{size:12}}},y:{beginAtZero:true}}
}
});
</script>
</body>
</html>