Review
Stitch anonymous kiln-slot browses to signed-in potters
KilnQueue growth wants anonymous schedule-browse events attributed to members after magic-link login. On successful auth, identify the Mixpanel distinct_id and people.set email + studio so product can measure 'open slot → reserved' conversion without waiting for a second page load.
MixpanelTier 2privacymixpanelconsentgdpr
Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.
src/auth/onMagicLinkSuccess.ts+8-1
| 12 | 12 | import mixpanel from "mixpanel-browser"; | |
| 13 | 13 | import { useConsentStore } from "@/consent/store"; | |
| 14 | 14 | import type { PotterSession } from "./types"; | |
| 15 | 15 | ||
| 16 | 16 | export function onMagicLinkSuccess(session: PotterSession) { | |
| 17 | 17 | localStorage.setItem("kq.session", JSON.stringify(session)); | |
| 18 | 18 | ||
| 19 | - | // Analytics wiring lands in a follow-up; keep login path lean for now. | |
| 19 | + | // Bridge anonymous distinct_id → member so funnel reports stitch. | |
| 20 | + | mixpanel.identify(session.potterId); | |
| 21 | + | mixpanel.people.set({ | |
| 22 | + | $email: session.email, | |
| 23 | + | studio_slug: session.studioSlug, | |
| 24 | + | plan: session.plan, | |
| 25 | + | }); | |
| 26 | + | mixpanel.track("potter_signed_in", { method: "magic_link" }); | |
| 20 | 27 | ||
| 21 | 28 | window.location.assign("/studio/kiln-board"); | |
| 22 | 29 | } | |
| 23 | 30 | ||
| 24 | 31 | // consent store already gates init/track elsewhere; unused here on purpose for now | |
| 25 | 32 | void useConsentStore; |