PHP + MySQL Analytics

Web Analytics Dashboard

A responsive analytics dashboard built directly into the site using PHP, MySQL, and Chart.js. The goal here was to show that I can take imported web performance data, query it on the backend, and turn it into a polished dashboard experience without relying on Power BI.

Dataset source: Kaggle Web Analytics Dataset

Data Source
CSV data imported through phpMyAdmin, cleaned into a query-friendly MySQL table, and used as the single source of truth.
Backend
PHP filters and SQL aggregations drive every KPI, chart, and summary table on the page.
Frontend
Chart.js, custom CSS, and a dashboard layout designed to feel more like a real analytics product than a class project.
Live Dashboard
Filterable performance view built on MySQL queries

The controls below update the entire dashboard using server-side filtering. That means the KPI cards, charts, and source summary all stay tied to the actual rows returned from the database.

Rows Available
250
Avg. Session Duration
1:35
Reset
Database test query passed

Connected successfully and loaded sample row: A / 2019-11

Total Users
2.82M
2,185,964 new users in scope
Total Sessions
4.02M
11,028,036 pageviews
Total Revenue
$3,693,194
37,526 units sold
Transactions
21,263
Completed purchases across the filtered view
Avg. Bounce Rate
61.23%
Weighted by sessions, not a flat row average
Avg. Conversion Rate
0.53%
Calculated from transactions divided by sessions
Traffic over time
Sessions and users from the filtered dataset
Server-side filters update this chart from MySQL query results, so the trend line always reflects the current dashboard scope.
Revenue trend
Revenue movement across the selected time range
Top sources / medium
Revenue by source, with transactions available in the tooltip
Top Revenue Source
A
Brought in $1,294,136 from 7,566 transactions.
Best Converting Source
S
Conversion rate of 33.58% with 11,634 sessions in scope.
Strongest Revenue Month
May 2020
Revenue peaked at $589,545 across 3,812 transactions.
Source / Medium performance summary
Users, sessions, revenue, transactions, bounce rate, and conversion rate grouped from MySQL.
Source / Medium Users Sessions Revenue Transactions Conversion Rate Bounce Rate
A 1,110,513 1,702,468 $1,294,136 7,566 0.44% 66.48%
S 6,197 11,634 $719,182 3,907 33.58% 19.87%
B 696,901 840,512 $540,692 2,838 0.34% 56.80%
U 2,830 6,336 $293,292 1,394 22.00% 33.95%
C 255,043 368,662 $207,764 1,689 0.46% 54.09%
E 185,065 328,563 $197,904 1,148 0.35% 54.87%
F 142,865 173,986 $149,046 823 0.47% 63.09%
G 53,214 86,987 $84,647 617 0.71% 56.35%
I 54,565 91,971 $54,376 392 0.43% 47.26%
M 17,944 23,186 $28,230 197 0.85% 51.54%
CC 1,333 1,765 $24,440 111 6.29% 33.88%
P 22,477 25,187 $16,480 100 0.40% 64.71%
H 71,565 97,793 $15,067 88 0.09% 56.83%
EE 620 1,138 $14,257 61 5.36% 31.29%
R 13,004 18,008 $9,438 61 0.34% 47.56%
Z 5,383 6,606 $6,994 34 0.51% 46.76%
l.M 4,680 6,247 $5,839 40 0.64% 28.73%
K 22,053 26,254 $5,021 35 0.13% 40.51%
T 3,357 5,754 $4,678 38 0.66% 39.24%
J 11,112 11,702 $4,009 27 0.23% 58.97%
l.K 5,004 5,644 $3,990 24 0.43% 13.91%
JJ 610 763 $3,880 8 1.05% 31.85%
L 10,271 24,629 $3,640 24 0.10% 74.65%
FF 1,213 1,455 $1,548 9 0.62% 45.50%
O 4,418 10,882 $1,527 9 0.08% 74.03%
DD 320 503 $1,307 9 1.79% 41.15%
II 102 214 $450 3 1.40% 42.06%
HH 81 215 $439 3 1.40% 25.58%
lI 660 1,112 $312 2 0.18% 44.33%
D 107,241 127,386 $290 2 0.00% 86.14%
V 2,507 2,638 $135 2 0.08% 55.50%
BB 382 1,133 $103 1 0.09% 71.49%
AA 2,697 3,012 $81 1 0.03% 58.27%
N 6,315 7,057 $0 0 0.00% 83.72%
Y 913 943 $0 0 0.00% 61.61%
GG 216 219 $0 0 0.00% 98.63%
KK 119 135 $0 0 0.00% 26.67%
euromessage / push 99 125 $0 0 0.00% 60.80%
What the dashboard does

This project takes a web analytics dataset imported into MySQL and turns it into a dashboard that can actually be explored inside the website. Instead of showing a static mockup, the page queries the database directly and rebuilds the metrics, charts, and source summary around the current filter selections.

The point of the project was to show the full stack of the workflow: importing the CSV, cleaning the fields for SQL use, writing the backend queries in PHP, and presenting the results in a polished dashboard that feels closer to a business analytics product than a basic admin table.

How the build works

I designed the data model so values like revenue, bounce rate, conversion rate, and session duration could be stored in normalized formats that are easy to aggregate. Once the data is cleaned, PHP uses filter values from the query string to build the SQL conditions and return the exact slice of data needed for the dashboard.

On the frontend, Chart.js handles the visual layer while the layout and styling are kept consistent with the rest of the portfolio. That let me keep the project grounded in real backend logic while still making the experience feel polished enough to showcase.

Tools used
PHP MySQL phpMyAdmin Chart.js HTML / CSS / JavaScript XAMPP SQL Aggregations Data Normalization
What I learned
How to turn a CSV that looks fine on the surface into a MySQL table that is actually reliable for real calculations.
How much cleaner a dashboard feels when the backend queries, filters, and frontend visuals are all designed together.
Why weighted calculations matter for metrics like bounce rate instead of just averaging percentages row by row.
How to build a portfolio dashboard that still shows real backend work instead of looking like a static design comp.