Quiz - Product analytics
You’re wiring up the consent banner and your instinct, fresh off the security chapter, is to wrap <Analytics /> and <SpeedInsights /> in the same useConsent() gate as everything else. What does the lesson say to do, and why?
A team already runs Mixpanel for events, LaunchDarkly for flags, and FullStory for replay — all best-in-class. The lesson argues PostHog’s one-platform play still wins. Which cost is the one that “quietly breaks everything”?
A teammate puts import posthog from 'posthog-js' at the top of the module and sets opt_out_capturing_by_default: true, reasoning that the SDK loads but stays silent until consent. Why does the lesson call this a production bug?
opt_out_capturing_by_default doesn’t actually exist on posthog.init, so the SDK captures from the first render.opt_out_capturing_by_default) governs a module that’s already loaded; belt two is the dynamic import('posthog-js') living inside the if (analytics) branch so the code never enters the page before consent. Trusting belt one alone leaves the SDK present on first load — the gate promised absent, not silent.Your app calls posthog.identify() correctly on every sign-in, and the data still gets corrupted: on shared machines, separate people’s events fuse into one profile. What’s missing?
posthog.reset() on sign-out — without it the distinct ID survives the logout, so the next person to sign in inherits the previous user’s identity.identify() call with the new user’s ID, which overrides the stale one when someone else signs in.group() call on sign-in, which scopes events to the org and keeps users from colliding.identify has a mandatory other half. reset() on sign-out clears the distinct ID, super-properties, and the identity link so the next session starts fresh and anonymous. A second identify() with a different ID actually fails — PostHog refuses to re-identify an already-identified distinct ID without a reset() first. And group() solves org-level attribution, not cross-user pollution.A new_onboarding flag has hit 100% and is stable. You want to remove it cleanly. Pick the sequence that avoids an outage.
if (flag) fork in code (keep the winning branch), merge and deploy, then delete the flag in PostHog.else branch that rots, which is why deletion is the last step of a rollout, not optional housekeeping.You’re deciding how session replay should treat the password field on your sign-in form. The lesson’s posture is “mask aggressively, block surgically.” Which is right here, and why?
*** but the interaction is still recorded, so you can confirm the user typed into the field and watch focus and validation behave.maskAllInputs is on by default, so password fields aren’t recorded at all.***; block removes the element entirely and you lose the interaction too. For a password the interaction matters for debugging — did focus land, did they type, did validation fire — so you mask. Block is reserved for cases where even the structure is sensitive or third-party (a PII iframe, rendered billing details). And maskAllInputs masks the value; it doesn’t stop recording the field.Quiz complete
Score by topic