diff --git a/app/controllers/idv/address_controller.rb b/app/controllers/idv/address_controller.rb index c97f24d8908..bc9639d60c1 100644 --- a/app/controllers/idv/address_controller.rb +++ b/app/controllers/idv/address_controller.rb @@ -6,12 +6,12 @@ class AddressController < ApplicationController before_action :confirm_pii_from_doc def new - analytics.track_event(Analytics::IDV_ADDRESS_VISIT) + analytics.idv_address_visit end def update form_result = idv_form.submit(profile_params) - analytics.track_event(Analytics::IDV_ADDRESS_SUBMITTED, form_result.to_h) + analytics.idv_address_submitted(**form_result.to_h) capture_address_edited(form_result) if form_result.success? success diff --git a/app/services/analytics.rb b/app/services/analytics.rb index 526d4d12db3..0a66451f4cf 100644 --- a/app/services/analytics.rb +++ b/app/services/analytics.rb @@ -124,11 +124,6 @@ def browser_attributes # rubocop:disable Layout/LineLength ACCOUNT_RESET_VISIT = 'Account deletion and reset visited' DOC_AUTH = 'Doc Auth' # visited or submitted is appended - IDV_ADDRESS_VISIT = 'IdV: address visited' - IDV_ADDRESS_SUBMITTED = 'IdV: address submitted' - IDV_BASIC_INFO_VISIT = 'IdV: basic info visited' - IDV_BASIC_INFO_SUBMITTED_FORM = 'IdV: basic info form submitted' - IDV_BASIC_INFO_SUBMITTED_VENDOR = 'IdV: basic info vendor submitted' IDV_CANCELLATION = 'IdV: cancellation visited' IDV_CANCELLATION_GO_BACK = 'IdV: cancellation go back' IDV_CANCELLATION_CONFIRMED = 'IdV: cancellation confirmed' diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index f0ca6c9e9ca..bd8f47005d5 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -361,6 +361,38 @@ def forget_all_browsers_visited track_event('Forget All Browsers Visited') end + # @identity.idp.event_name Idv address submitted + # @param [Boolean] success + # @param [Boolean] address_edited + # @param [Hash] pii_like_keypaths + # @param [Hash] errors + # @param [Hash] error_details + # User submitted an idv address + def idv_address_submitted( + success:, + errors:, + address_edited: nil, + pii_like_keypaths: nil, + error_details: nil, + **extra + ) + track_event( + 'IdV: address submitted', + success: success, + errors: errors, + address_edited: address_edited, + pii_like_keypaths: pii_like_keypaths, + error_details: error_details, + **extra, + ) + end + + # @identity.idp.event_name Idv Address Visit + # User visited idv address page + def idv_address_visit + track_event('IdV: address visited') + end + # @deprecated # A user has downloaded their personal key. This event is no longer emitted. # @identity.idp.event_name IdV: personal key downloaded