diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index a68e4db522f..c01e882cf95 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -9,7 +9,7 @@ class HybridHandoffController < ApplicationController before_action :confirm_hybrid_handoff_needed, only: :show def show - analytics.idv_doc_auth_upload_visited(**analytics_arguments) + analytics.idv_doc_auth_hybrid_handoff_visited(**analytics_arguments) Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).call( 'upload', :view, @@ -63,7 +63,7 @@ def handle_phone_submission idv_session.flow_path = nil end - analytics.idv_doc_auth_upload_submitted( + analytics.idv_doc_auth_hybrid_handoff_submitted( **analytics_arguments.merge(telephony_form_response.to_h), ) end @@ -116,7 +116,7 @@ def bypass_send_link_steps idv_session.flow_path = 'standard' redirect_to idv_document_capture_url - analytics.idv_doc_auth_upload_submitted( + analytics.idv_doc_auth_hybrid_handoff_submitted( **analytics_arguments.merge( form_response(destination: :document_capture).to_h, ), @@ -153,7 +153,7 @@ def rate_limiter def analytics_arguments { - step: 'upload', + step: 'hybrid_handoff', analytics_id: 'Doc Auth', irs_reproofing: irs_reproofing?, redo_document_capture: params[:redo] ? true : nil, diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 9c833412003..22996265dec 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -682,6 +682,21 @@ def idv_doc_auth_exception_visited(step_name:, remaining_attempts:, **extra) ) end + # The "hybrid handoff" step: Desktop user has submitted their choice to + # either continue via desktop ("document_capture" destination) or switch + # to mobile phone ("send_link" destination) to perform document upload. + # Mobile users still log this event but with skip_upload_step = true + # @identity.idp.previous_event_name IdV: doc auth upload submitted + def idv_doc_auth_hybrid_handoff_submitted(**extra) + track_event('IdV: doc auth hybrid handoff submitted', **extra) + end + + # Desktop user has reached the above "hybrid handoff" view + # @identity.idp.previous_event_name IdV: doc auth upload visited + def idv_doc_auth_hybrid_handoff_visited(**extra) + track_event('IdV: doc auth hybrid handoff visited', **extra) + end + # @identity.idp.previous_event_name IdV: doc auth send_link submitted def idv_doc_auth_link_sent_submitted(**extra) track_event('IdV: doc auth link_sent submitted', **extra) @@ -839,19 +854,6 @@ def idv_doc_auth_submitted_pii_validation( ) end - # The "hybrid handoff" step: Desktop user has submitted their choice to - # either continue via desktop ("document_capture" destination) or switch - # to mobile phone ("send_link" destination) to perform document upload. - # Mobile users still log this event but with skip_upload_step = true - def idv_doc_auth_upload_submitted(**extra) - track_event('IdV: doc auth upload submitted', **extra) - end - - # Desktop user has reached the above "hybrid handoff" view - def idv_doc_auth_upload_visited(**extra) - track_event('IdV: doc auth upload visited', **extra) - end - def idv_doc_auth_verify_proofing_results(**extra) track_event('IdV: doc auth verify proofing results', **extra) end diff --git a/spec/controllers/idv/hybrid_handoff_controller_spec.rb b/spec/controllers/idv/hybrid_handoff_controller_spec.rb index e215610da96..351a059ecb6 100644 --- a/spec/controllers/idv/hybrid_handoff_controller_spec.rb +++ b/spec/controllers/idv/hybrid_handoff_controller_spec.rb @@ -44,9 +44,9 @@ end describe '#show' do - let(:analytics_name) { 'IdV: doc auth upload visited' } + let(:analytics_name) { 'IdV: doc auth hybrid handoff visited' } let(:analytics_args) do - { step: 'upload', + { step: 'hybrid_handoff', analytics_id: 'Doc Auth', irs_reproofing: false } end @@ -137,7 +137,7 @@ end describe '#update' do - let(:analytics_name) { 'IdV: doc auth upload submitted' } + let(:analytics_name) { 'IdV: doc auth hybrid handoff submitted' } context 'hybrid flow' do let(:analytics_args) do @@ -145,7 +145,7 @@ errors: { message: nil }, destination: :link_sent, flow_path: 'hybrid', - step: 'upload', + step: 'hybrid_handoff', analytics_id: 'Doc Auth', irs_reproofing: false, telephony_response: { errors: {}, @@ -168,7 +168,7 @@ errors: {}, destination: :document_capture, flow_path: 'standard', - step: 'upload', + step: 'hybrid_handoff', analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false } diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 2f5041d989c..f429f24d8f2 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -16,8 +16,8 @@ 'IdV: doc auth agreement visited' => { step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: consent checkbox toggled' => { checked: true }, 'IdV: doc auth agreement submitted' => { success: true, errors: {}, step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload visited' => { step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, + 'IdV: doc auth hybrid handoff visited' => { step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, + 'IdV: doc auth hybrid handoff submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, @@ -51,8 +51,8 @@ 'IdV: doc auth welcome submitted' => { step: 'welcome', analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth agreement visited' => { step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth agreement submitted' => { success: true, errors: {}, step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload visited' => { step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, + 'IdV: doc auth hybrid handoff visited' => { step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, + 'IdV: doc auth hybrid handoff submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, @@ -79,8 +79,8 @@ 'IdV: doc auth welcome submitted' => { step: 'welcome', analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth agreement visited' => { step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth agreement submitted' => { success: true, errors: {}, step: 'agreement', analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload visited' => { step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, + 'IdV: doc auth hybrid handoff visited' => { step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, + 'IdV: doc auth hybrid handoff submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false, skip_upload_step: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, diff --git a/spec/features/idv/doc_auth/hybrid_handoff_spec.rb b/spec/features/idv/doc_auth/hybrid_handoff_spec.rb index 119b4035cbc..302dd710bde 100644 --- a/spec/features/idv/doc_auth/hybrid_handoff_spec.rb +++ b/spec/features/idv/doc_auth/hybrid_handoff_spec.rb @@ -40,8 +40,8 @@ expect(page).to have_current_path(idv_link_sent_path) expect(fake_analytics).to have_logged_event( - 'IdV: doc auth upload submitted', - hash_including(step: 'upload', destination: :link_sent), + 'IdV: doc auth hybrid handoff submitted', + hash_including(step: 'hybrid_handoff', destination: :link_sent), ) visit(idv_hybrid_handoff_url) diff --git a/spec/features/idv/doc_auth/redo_document_capture_spec.rb b/spec/features/idv/doc_auth/redo_document_capture_spec.rb index 7b0fdcea824..0137b789e92 100644 --- a/spec/features/idv/doc_auth/redo_document_capture_spec.rb +++ b/spec/features/idv/doc_auth/redo_document_capture_spec.rb @@ -43,7 +43,7 @@ expect(current_path).to eq(idv_hybrid_handoff_path) expect(fake_analytics).to have_logged_event( - 'IdV: doc auth upload visited', + 'IdV: doc auth hybrid handoff visited', hash_including(redo_document_capture: true), ) complete_hybrid_handoff_step