A first-party web analytics system that turns website traffic into CRM context.
I built the browser tracker, session and visit pipeline, custom event system, and CRM handoff for an in-house alternative to Google Analytics—now holding more than 50 million session rows and 86 million visit rows that remain individually queryable in MySQL.
Role
Technical Director
Context
Multi-tenant business platform
Disclosure
Client-anonymous
The problem
The problem
Clients wanted the familiar usefulness of Google Analytics, but with the visitor history, attribution, conversions, and follow-up context connected to the CRM where work actually happens. That means capturing the messy reality of the web—repeat page activity, campaign parameters, referrers, devices, bots, click events, and incomplete context—without making a client website wait on a database operation for every visitor action.
50M+session rows
86M+visit rows
Uswho owns the data
MySQLindividually queryable records
What I built
The system, not just the screen.
A small client-side tracker with a durable session model
Built the script a client adds to their site, session persistence, and the endpoint that accepts a page hit quickly. The backend keeps a session as the larger visitor story and separate visit records as the page-by-page sequence, including referral and attribution context, page history, and time on page.
An analytics pipeline designed for real volume
Moved parsing, device detection, UTM normalization, website resolution, session creation, and visit writes onto a dedicated analytics queue and connection. The processing path retries sensitive writes, uses transactions, resolves duplicate session creation safely, and updates page timing only when a dependable next page view arrives.
Traffic that can become a real operating signal
Built a custom event path for form submissions, click-to-call intent, and other goals. Each event belongs to both its session and its specific visit, so a click sequence or completed form can be understood in the visitor’s actual path—not counted as an isolated goal. Sessions can then connect to known leads, contacts, accounts, campaigns, and conversion records when context exists.
System sketch
How the system works.
A simplified view of the system boundary and the work it moves through.
Client site script
Fast tracking endpoint
Analytics queue
Session + visit rows
CRM, conversions + reporting
Key decisions
Key decisions
Keep the client-side contract small and return immediately from the tracking endpoint; the consequential work belongs on the analytics queue.
Model sessions, visits, and custom events separately so reporting can retain both the overall visitor story and granular page or goal activity.
Use retries, transactions, and explicit session identity to make concurrent browser activity durable at scale.
Connect traffic to CRM records and conversions when identification exists, but keep unaffiliated visitor traffic useful for attribution and reporting too.
What it enables
What it enables
The result is a first-party analytics foundation with Google-Analytics-like breadth and CRM-native usefulness: more than 50 million sessions and 86 million visits can be queried individually, while the people using the platform can move from a traffic source, click sequence, form event, or goal to the visitor path, conversion context, and—when known—the actual customer record.