Developer Builds Free Real-Time Visitor Tracker Using Firebase to Replace Tidio
A developer created a custom real-time visitor tracking tool after a client wanted to monitor live site activity and current page visits without paying for a Tidio subscription. The solution used Firebase Realtime Database's onDisconnect() mechanism to automatically remove visitor records when a session ends, regardless of how the browser or connection drops. A lightweight JavaScript file, loaded via a single script tag in the WordPress site's header, connects to an external Firebase project without modifying the CMS or its hosting environment. Visitor data including current page, referrer, UTM parameters, and user agent is stored in Firestore alongside IP geolocation for persistent history. A key debugging challenge involved a browser CORS error that was concealing a server-side crash triggered by an empty string being passed instead of a null value.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in