Product analytics with Mixpanel, built into the front-end
I implement Mixpanel in React and TypeScript applications: a typed tracking plan, events that answer real product questions, session replay, and a privacy-conscious setup with EU data residency.
Most analytics problems are front-end problems. Events get named three different ways, fire twice, or fire on every key press until the reports are unreadable. I treat the tracking plan as part of the codebase: every Mixpanel event and its properties are one TypeScript type, so a misspelt event name or a missing property fails the build instead of polluting the data.
I start from the questions the product needs answered and work back to the smallest set of events that answers them. Noisy interactions are recorded once per meaningful unit, automated behaviour is kept out, and context such as entry point or device capabilities rides along on every event so reports can be split without extra work.
Privacy is a design decision, not an afterthought. I have run Mixpanel without cookies or local storage, with IP-based location switched off, on Mixpanel's EU endpoint, and with development traffic kept out of production data. Where session replay and heatmaps are worth it, I set them up with masking and am explicit about what that stores and sends.
This site runs on Mixpanel too: page views, call-to-action clicks, contact form submissions and outbound project links are all tracked events.
What this covers
- Mixpanel implementation in React, Vue and TypeScript
- Typed tracking plans and event naming conventions
- Cookie-free and persistence-free tracking
- EU data residency setup
- Session replay and heatmaps
- Funnels around a product's value moment
- Keeping development and bot traffic out of the data
Where I did this
- Nebula·3 (2026): Mixpanel with eight typed events, no cookies or local storage, the EU endpoint and session replay, used to see which presets people pick and how they play.
Related writing
By Guus van de Wal, Senior Front-end Developer & UI Engineer.