Login Analytics Events
This document outlines all the analytics events tracked during the login process, particularly for magic login flows.
Magic Login Authentication Events
calypso_login_magic_authenticate_attempt
Description: Tracks when a magic login authentication is attempted (either code or link)
Properties:
flow(string|null): The client's login flow (e.g., gravatar flows)token_type(string): Either "code" or "link"
calypso_login_magic_authenticate_success
Description: Tracks successful magic login authentication
Properties:
flow(string|null): The client's login flowtoken_type(string): Either "code" or "link"
calypso_login_magic_authenticate_failure
Description: Tracks failed magic login authentication attempts
Properties:
flow(string|null): The client's login flowtoken_type(string): Either "code" or "link"error_code(number): HTTP status code of the errorerror_message(string): Error type/message
Magic Code Verification Events
calypso_login_magic_code_submit
Description: Tracks when user submits a magic code for verification
Properties:
code_length(number): Length of the submitted verification code
Email Link Events
calypso_login_email_link_submit
Description: Tracks when user requests a magic login email
Properties:
flow(string|null): The client's login flowtoken_type(string): Token type being requested
calypso_login_email_link_success
Description: Tracks successful email link request
Properties:
flow(string|null): The client's login flowtoken_type(string): Token type that was requested
calypso_login_email_link_failure
Description: Tracks failed email link requests
Properties:
flow(string|null): The client's login flowtoken_type(string): Token type that was requestederror_code(string): Error code from the APIerror_message(string): Error message from the API
calypso_login_email_link_handle_click_view
Description: Tracks when user views the email link handling page
Properties: None
General Login Events
calypso_login_success
Description: Tracks overall successful login completion
Properties:
is_jetpack(boolean): Whether this is a Jetpack loginis_magic_login(boolean): Whether magic login was usedlogin_method(string): The method used for login
Event Flow
- Email Request:
calypso_login_email_link_submit→calypso_login_email_link_success/calypso_login_email_link_failure - Link Click:
calypso_login_email_link_handle_click_view - Code Entry (if applicable):
calypso_login_magic_code_submit - Authentication:
calypso_login_magic_authenticate_attempt→calypso_login_magic_authenticate_success/calypso_login_magic_authenticate_failure - Final Success:
calypso_login_success
Implementation Files
- Email requests:
client/state/data-layer/wpcom/auth/send-login-email/index.js - Authentication:
client/state/login/magic-login/actions.js - Code verification:
client/login/magic-login/verify-login-code.jsx - Final login:
client/state/login/actions/reboot-after-login.ts