Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:,
Expand All @@ -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(
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion app/services/idv/send_phone_confirmation_otp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,23 @@ 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,
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
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
Expand Down