diff --git a/app/controllers/banned_user_controller.rb b/app/controllers/banned_user_controller.rb index 287219e07f7..848b9f04010 100644 --- a/app/controllers/banned_user_controller.rb +++ b/app/controllers/banned_user_controller.rb @@ -1,5 +1,5 @@ class BannedUserController < ApplicationController def show - analytics.track_event(Analytics::BANNED_USER_VISITED) + analytics.banned_user_visited end end diff --git a/app/controllers/users/email_confirmations_controller.rb b/app/controllers/users/email_confirmations_controller.rb index 8ec43038368..d3d08701dc3 100644 --- a/app/controllers/users/email_confirmations_controller.rb +++ b/app/controllers/users/email_confirmations_controller.rb @@ -2,7 +2,7 @@ module Users class EmailConfirmationsController < ApplicationController def create result = email_confirmation_token_validator.submit - analytics.track_event(Analytics::ADD_EMAIL_CONFIRMATION, result.to_h) + analytics.add_email_confirmation(**result.to_h) if result.success? process_successful_confirmation(email_address) else diff --git a/app/services/analytics.rb b/app/services/analytics.rb index caaf1d47519..b0e7c6209d1 100644 --- a/app/services/analytics.rb +++ b/app/services/analytics.rb @@ -123,11 +123,6 @@ def browser_attributes # rubocop:disable Layout/LineLength ACCOUNT_RESET_VISIT = 'Account deletion and reset visited' - ADD_EMAIL = 'Add Email: Email Submitted' - ADD_EMAIL_CONFIRMATION = 'Add Email: Email Confirmation' - ADD_EMAIL_CONFIRMATION_RESEND = 'Add Email: Email Confirmation requested due to invalid token' - ADD_EMAIL_VISIT = 'Add Email: enter email visited' - BANNED_USER_VISITED = 'Banned User visited' BROKEN_PERSONAL_KEY_REGENERATED = 'Broken Personal Key: Regenerated' DOC_AUTH = 'Doc Auth' # visited or submitted is appended DOC_AUTH_ASYNC = 'Doc Auth Async' diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 113c210836d..945b661cf44 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -84,6 +84,14 @@ def account_visit track_event('Account Page Visited') end + # @identity.idp.event_name Add Email: Email Confirmation + # @param [Boolean] success + # @param [String] user_id account the email is linked to + # A user has clicked the confirmation link in an email + def add_email_confirmation(user_id:, **extra) + track_event('Add Email: Email Confirmation', user_id: user_id, **extra) + end + # @identity.idp.event_name Authentication Confirmation # When a user views the "you are already signed in with the following email" screen def authentication_confirmation @@ -111,6 +119,13 @@ def banned_user_redirect track_event('Banned User redirected') end + # @identity.idp.event_name Banned User visited + # A user that has been banned from an SP has authenticated, they have visited + # a page showing them that they have been banned + def banned_user_visited + track_event('Banned User visited') + end + # @identity.idp.event_name IdV: phone confirmation otp submitted # @param [Boolean] success # @param [Hash] errors