Repository navigation
Conversation
New Mixpanel event `app_login_completed` with `source` (startup_prompt, header, health_check, login_dialog) and `login_prompt_cohort`. A logged-out user has no analytics session, so a successful login's source is held until analytics starts for that account, signalled by a new `analytics-started` event. A login is only held if analytics consent was already given when it completed: agreeing afterwards doesn't cover it. Each login keeps the cohort it was made in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of STA-574, stacked on #24969 (the login modal and new dialog behind the
vortex-sta-574-login-promptflag). Merge that first. This PR's base will then move tomaster.Counts Vortex logins, and which button started each one, so the STA-574 experiment's cohorts can be compared.
The event
New Mixpanel event
app_login_completed:source:startup_prompt,header,health_checkorlogin_dialog.login_dialogis the dialog's own button, opened byensureLoggedInfor things like nxm links. The classic UI's header icon isn't counted.login_prompt_cohort:testorcontrol, the cohort the login was made in. While the flag is off, every event sayscontrol, which gives a baseline before the experiment starts.When it's sent
Logged-out users have no analytics session, so a click in the modal can't be tracked. Instead, a successful login's source is held in memory until analytics starts for that account. A new
analytics-startedevent on the extension bus, emitted by the analytics extension, signals that.Consent comes first. A login is only held if the user had already agreed to analytics when it completed. Agreeing afterwards, including at the consent prompt that follows a first login, doesn't cover a login that happened before it. Abandoned logins send nothing either.
What it can show
Consent is first asked after a login, so a user's first login is never counted. The cohort comparison therefore covers returning users: people who agreed to analytics earlier and later logged out. It doesn't cover the never-logged-in users the modal mostly targets.
The random split keeps the comparison fair within that group, but it likely understates the modal's overall effect. Measuring everyone would mean recording Vortex-side login details, such as the button or cohort, outside the user's analytics choice, for example on the OAuth link. We deliberately don't do that.
Analysis tips:
app_version(a super property) at or above the release, since only updated installs send the event.Testing
Unit tests cover:
Typecheck and lint pass. E2E was not run.
Tested live: a login through the modal arrived in Mixpanel's development project as
app_login_completed. That run predates the consent rule, so it was sent even though consent came after the login; under this PR it would not be. A login made with consent already on hasn't been tested live yet.🤖 Generated with Claude Code