Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the registration event tracking system from individual analytics.event calls to a centralized registrationFunnel trigger approach for the registration flow. The changes include introducing a new registrationFunnel utility, updating SPA initialization in index.ts to initialize the funnel, and replacing various analytics.event calls in the registration flows (including passkey creation, registration steps, and finish events).
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/utils/analytics/registrationFunnel.ts | Introduces the registrationFunnel utility and RegistrationEvents object |
| src/frontend/src/index.ts | Initializes the registrationFunnel within SPA creation |
| src/frontend/src/flows/register/passkey.ts | Replaces analytics.event calls with a funnel trigger for passkey creation |
| src/frontend/src/flows/register/index.ts | Updates the registration flow event tracking to use the funnel trigger |
| src/frontend/src/flows/register/finish.ts | Adds a funnel trigger when a user copies their new identity number |
| src/frontend/src/components/authenticateBox/index.ts | Removes analytics.event calls related to registration events |
Comments suppressed due to low confidence (8)
src/frontend/src/flows/register/passkey.ts:142
- The success event for passkey creation was removed without a replacement. Consider adding a registrationFunnel.trigger call to track passkey creation success.
analytics.event("construct-passkey-success");
src/frontend/src/flows/register/passkey.ts:145
- The error event for passkey creation was removed without a corresponding replacement. If error tracking is required, add a registrationFunnel.trigger call for passkey errors.
analytics.event("construct-passkey-error");
src/frontend/src/flows/register/index.ts:152
- The 'registration-pin' event is removed without a replacement. Consider adding a registrationFunnel.trigger call if tracking of PIN registration is required.
analytics.event("registration-pin");
src/frontend/src/flows/register/index.ts:182
- The 'registration-openid' event is removed without being replaced. If openid registration tracking is needed, add a registrationFunnel.trigger call.
analytics.event("registration-openid");
src/frontend/src/flows/register/index.ts:235
- The 'registration-final-error' event is removed without a registrationFunnel alternative. Consider adding a corresponding trigger for final error events.
analytics.event("registration-final-error");
src/frontend/src/flows/register/index.ts:536
- The 'registration-start-error' event is removed without a replacement. Consider adding a registrationFunnel.trigger call to handle errors during registration start.
analytics.event("registration-start-error");
src/frontend/src/flows/register/index.ts:548
- The 'registration-captcha-cancelled' event is removed without a replacement. Consider triggering a funnel event to capture captcha cancellation events.
analytics.event("registration-captcha-cancelled");
src/frontend/src/flows/register/index.ts:551
- The 'registration-captcha-error' event is removed without a replacement. If captcha errors should be tracked, add a call to registrationFunnel.trigger.
analytics.event("registration-captcha-error");
Motivation
Track registration flow as described in the design doc of the analytics baseline.
The main change is the replacement of the
analytics.eventcalls with a newregistrationFunnelsystem to track registration events more systematically.Changes
src/frontend/src/flows/register/index.ts: Replaced multipleanalytics.eventcalls withregistrationFunnel.triggerto track various stages of the registration process, such as triggering the registration, checking captcha, creating an identity, and successful registration.src/frontend/src/flows/register/passkey.ts: Updated the passkey creation process to useregistrationFunnel.triggerfor tracking events instead ofanalytics.event.src/frontend/src/components/authenticateBox/index.ts: Removedanalytics.eventcalls related to registration events.src/frontend/src/index.ts: Added initialization ofregistrationFunnelin the SPA creation process to ensure it is set up for tracking registration-related events.src/frontend/src/utils/analytics/registrationFunnel.ts: Introduced a newRegistrationEventsobject andregistrationFunnelinstance to standardize the registration event tracking.src/frontend/src/flows/register/finish.ts: Added a call toregistrationFunnel.triggerwhen the user copies their new identity number.Tests
Tested locally that events are triggered along the registration flow.
🟡 Some screens were changed