Only one analytics instance is initialized
Why it matters
Duplicate initialization doubles every event. Pageview counts inflate, conversion rates halve against truth, session counts get split across two cookies, and funnel steps show impossible transitions because the same user is being tracked as two identities. Once bad data is in GA4 or PostHog you cannot retroactively deduplicate it — every historical report based on that period is permanently corrupted. A/B test significance calculations lie. Board metrics lie.
Severity rationale
Medium because duplicate events corrupt historical data irreversibly but do not break user-facing functionality.
Remediation
Consolidate every posthog.init(), gtag('config', ...), or mixpanel.init() call into a single provider at src/components/analytics-provider.tsx mounted once in the root layout. Delete every per-page initialization. Multiple providers tracking different surfaces (Vercel Analytics plus PostHog) are fine; two instances of the same provider are not. Grep the repo for every init call before shipping the fix.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Analytics & Tracking Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from marketing-analytics·automated