Lightweight Visitor Analytics with MySQLi

Lightweight Visitor Analytics with MySQLi

Instead of pulling in a third-party analytics script, I log page visits directly into a visitor_logs table via a tiny fetch() call.

It captures IP, user agent, page URL, referrer, and timestamp — enough to understand traffic patterns without compromising visitor privacy with cross-site trackers.

Analytics dashboard sketch

Comments (0)