18F / identity-idp

Login.gov Core App: Identity Provider (IdP)
https://secure.login.gov/
Other
524 stars 112 forks source link

LG-14389: Add analytics for consent screen email selection #11321

Closed aduth closed 4 weeks ago

aduth commented 4 weeks ago

🎫 Ticket

LG-14389

🛠 Summary of changes

Logs analytics events when the user visits and submits the email selection screen when prompted to consent to share information with a partner.

This leverages existing analytics events created for changing the selected email for a partner in LG-13665 (#11196), using the property needs_completion_screen_reason to differentiate if the email was changed stemming from the consent screen.

📜 Testing Plan

Prerequisites:

Validate that the expected events are logged:

  1. Run make watch_events in a separate terminal process
  2. Run sample application in a separate terminal process
  3. Go to http://localhost:9292
  4. Click "Sign in"
  5. Sign in
  6. When prompted to consent to share information, click "Edit email address"
  7. Observe in make watch_events terminal process the event sp_select_email_visited with a needs_completion_screen_reason value
  8. Submit the page with your preferred email to share
  9. Observe in make watch_events terminal process the event sp_select_email_submitted with success: true and a needs_completion_screen_reason value