What problem does it solve? Adding product analytics to a marketing site often hurts page performance, leaks PII, or fires events in development environments. This Skill wires PostHog Cloud into a Vite + React or Next.js site with browser-only lazy loading, production gating, and non-PII event tracking. ## Core Features & Use Cases - Gated Initialization: Loads posthog-js dynamically only in production builds with a configured project API key, keeping dev and prerender output free of PostHog traffic. - Centralized Event Capture: Routes all events through a single analytics helper so payloads stay consistent and non-PII, with autocapture disabled by default. - Framework Tracks: Covers both Vite + React (VITE_* env vars, init after mount) and Next.js (NEXT_PUBLIC_* vars, client provider, pathname-based pageview capture). - Use Case: You have a production marketing site and want funnel and retention analytics without blocking first paint or sending user data — this Skill sets up the env vars, helper module, and validation checks. ## Quick Start Set up PostHog analytics on my Vite React site with production-only lazy loading and non-PII event tracking.