fix(analytics): stop orphaning anonymous person on load, breaking signup attribution #83
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
__root identify effect called posthog.reset() whenever
userwas falsy —which includes the brief window while the session resolves on every page
load. After the signup hard-redirect this rotated the anonymous distinct_id,
orphaning the pre-signup anonymous person that carries
user_signed_upandfirst-touch
$initial_utm_*. The later identify() then merged a fresh, emptyanon id, so signups never linked to trial/payment (only ~16% stitched) and
channel attribution read "(none)" for 100% of signups.
identified -> anonymous transition (logout), tracked via a ref. Logout
still resets via dashboard handleSignOut.
firing user_signed_up, so the anon->identified merge carries $initial_utm_*
and attributes the signup (email flow; Google is handled on OAuth return).
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com