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
2 changes: 1 addition & 1 deletion app/controllers/idv/otp_delivery_method_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OtpDeliveryMethodController < ApplicationController
before_action :set_idv_phone

def new
analytics.track_event(Analytics::IDV_PHONE_OTP_DELIVERY_SELECTION_VISIT)
analytics.idv_phone_otp_delivery_selection_visit
render :new, locals: { gpo_letter_available: gpo_letter_available }
end

Expand Down
6 changes: 2 additions & 4 deletions app/controllers/idv/phone_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ class PhoneController < ApplicationController
before_action :set_idv_form

def new
if params[:step]
analytics.track_event(Analytics::IDV_PHONE_USE_DIFFERENT, step: params[:step])
end
analytics.idv_phone_use_different(step: params[:step]) if params[:step]

redirect_to failure_url(:fail) and return if throttle.throttled?

async_state = step.async_state
if async_state.none?
analytics.track_event(Analytics::IDV_PHONE_RECORD_VISIT)
analytics.idv_phone_of_record_visited
render :new, locals: { gpo_letter_available: gpo_letter_available }
elsif async_state.in_progress?
render :wait
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/idv/review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def confirm_current_password
def new
@applicant = idv_session.applicant
@step_indicator_steps = step_indicator_steps
analytics.track_event(Analytics::IDV_REVIEW_VISIT)
analytics.idv_review_info_visited

gpo_mail_service = Idv::GpoMail.new(current_user)
flash_now = flash.now
Expand All @@ -45,7 +45,7 @@ def create
init_profile
user_session[:need_personal_key_confirmation] = true
redirect_to next_step
analytics.track_event(Analytics::IDV_REVIEW_COMPLETE)
analytics.idv_review_complete
analytics.idv_final(success: true)

return unless FeatureManagement.reveal_gpo_code?
Expand Down
5 changes: 0 additions & 5 deletions app/services/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ def session_started_at
IDV_INTRO_VISIT = 'IdV: intro visited'
IDV_JURISDICTION_VISIT = 'IdV: jurisdiction visited'
IDV_JURISDICTION_FORM = 'IdV: jurisdiction form submitted'
IDV_PHONE_OTP_DELIVERY_SELECTION_VISIT = 'IdV: Phone OTP delivery Selection Visited'
IDV_PHONE_USE_DIFFERENT = 'IdV: use different phone number'
IDV_PHONE_RECORD_VISIT = 'IdV: phone of record visited'
IDV_REVIEW_COMPLETE = 'IdV: review complete'
IDV_REVIEW_VISIT = 'IdV: review info visited'
IDV_START_OVER = 'IdV: start over'
IDV_GPO_ADDRESS_LETTER_REQUESTED = 'IdV: USPS address letter requested'
IDV_GPO_ADDRESS_SUBMITTED = 'IdV: USPS address submitted'
Expand Down
30 changes: 30 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,36 @@ def idv_phone_otp_delivery_selection_submitted(
)
end

# User visited idv phone of record
def idv_phone_of_record_visited
track_event('IdV: phone of record visited')
end

# User visited idv phone OTP delivery selection
def idv_phone_otp_delivery_selection_visit
track_event('IdV: Phone OTP delivery Selection Visited')
end

# @param [String] step the step the user was on when they clicked use a different phone number
# User decided to use a different phone number in idv
def idv_phone_use_different(step:, **extra)
track_event(
'IdV: use different phone number',
step: step,
**extra,
)
end

# User completed idv
def idv_review_complete
track_event('IdV: review complete')
end

# User visited idv phone of record
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review step is where the user reviews the PII we have for them right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this is actually after they encrypt their password. It's very misleading. 'IdV: final resolution' was created to make it clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but it looks like this description was copy-pasted... both idv_phone_of_record_visited and idv_review_info_visited have the comment "User visited idv phone of record"

def idv_review_info_visited
track_event('IdV: review info visited')
end

# User has visited the page that lets them confirm if they want a new personal key
def profile_personal_key_visit
track_event('Profile: Visited new personal key')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Funnel
module DocAuth
class RegisterStepFromAnalyticsViewEvent
ANALYTICS_EVENT_TO_DOC_AUTH_LOG_TOKEN = {
Analytics::IDV_PHONE_RECORD_VISIT => :verify_phone,
Analytics::IDV_REVIEW_VISIT => :encrypt,
'IdV: phone of record visited' => :verify_phone,
'IdV: review info visited' => :encrypt,
'IdV: final resolution' => :verified,
Analytics::IDV_GPO_ADDRESS_VISITED => :usps_address,
}.freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
get :new

expect(@analytics).to have_received(:track_event).
with(Analytics::IDV_PHONE_OTP_DELIVERY_SELECTION_VISIT)
with('IdV: Phone OTP delivery Selection Visited')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/phone_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
get :new, params: params

expect(@analytics).to have_received(:track_event).
with(Analytics::IDV_PHONE_USE_DIFFERENT, step: step)
with('IdV: use different phone number', step: step)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/review_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def show
it 'redirects to personal key path' do
put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } }

expect(@analytics).to have_received(:track_event).with(Analytics::IDV_REVIEW_COMPLETE)
expect(@analytics).to have_received(:track_event).with('IdV: review complete')
expect(@analytics).to have_received(:track_event).with(
'IdV: final resolution',
success: true,
Expand Down