diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index b874bbe0812..cd2b15c6291 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2851,6 +2851,7 @@ def idv_phone_confirmation_otp_rate_limit_sends( # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components # @param [String,nil] active_profile_idv_level ID verification level of user's active profile. # @param [String,nil] pending_profile_idv_level ID verification level of user's pending profile. + # @param [Hash, nil] ab_tests data for ongoing A/B tests # The user resent an OTP during the IDV phone step def idv_phone_confirmation_otp_resent( success:, @@ -2864,6 +2865,7 @@ def idv_phone_confirmation_otp_resent( proofing_components: nil, active_profile_idv_level: nil, pending_profile_idv_level: nil, + ab_tests: nil, **extra ) track_event( @@ -2879,6 +2881,7 @@ def idv_phone_confirmation_otp_resent( proofing_components: proofing_components, active_profile_idv_level: active_profile_idv_level, pending_profile_idv_level: pending_profile_idv_level, + ab_tests: ab_tests, **extra, ) end diff --git a/app/services/idv/send_phone_confirmation_otp.rb b/app/services/idv/send_phone_confirmation_otp.rb index 036ed2e6672..1770541eaba 100644 --- a/app/services/idv/send_phone_confirmation_otp.rb +++ b/app/services/idv/send_phone_confirmation_otp.rb @@ -105,7 +105,7 @@ def otp_sent_response end def extra_analytics_attributes - { + attributes = { otp_delivery_preference: delivery_method, country_code: parsed_phone.country, area_code: parsed_phone.area_code, @@ -113,6 +113,15 @@ def extra_analytics_attributes rate_limit_exceeded: rate_limit_exceeded?, telephony_response: @telephony_response, } + if IdentityConfig.store.ab_testing_idv_ten_digit_otp_enabled + attributes[:ab_tests] = { + AbTests::IDV_TEN_DIGIT_OTP.experiment_name => { + bucket: bucket, + }, + } + end + + attributes end def parsed_phone