Skip to content

[Logging] Log an event when the user chooses to use a different number. (LG-5259)#5719

Merged
solipet merged 3 commits intomainfrom
dprice-lg-5259-phone-logging
Dec 16, 2021
Merged

[Logging] Log an event when the user chooses to use a different number. (LG-5259)#5719
solipet merged 3 commits intomainfrom
dprice-lg-5259-phone-logging

Conversation

@solipet
Copy link
Contributor

@solipet solipet commented Dec 16, 2021

Currently "use a different phone number" links on both the IAL2 phone OTP pages aren't logged at all. This PR adds a location param to the link on each page with the path it is coming from, and if that location param is present, logs a new event.

@solipet solipet requested a review from aduth December 16, 2021 17:45

def new
if params[:location]
analytics.track_event(Analytics::IDV_PHONE_USE_DIFFERENT, location: params[:location])
Copy link
Contributor

Choose a reason for hiding this comment

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

Elsewhere, we use "location" as a way to disambiguate different links within an individual step, whereas here it's a path. We also log "step" in a lot of cases too.

What do you think about logging step instead? Or something like from_step, if that's clearer?

There's a value in the view we use for cancel links:

<%= render 'idv/doc_auth/start_over_or_cancel', step: 'phone_otp_delivery_selection' %>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was going to ask about that ;-) updated in 76faec6

@solipet solipet force-pushed the dprice-lg-5259-phone-logging branch from 336757a to 76faec6 Compare December 16, 2021 18:21
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Looks good 👍

end

context 'when the user has chosen to use a different number' do
let(:step) { 'path_where_user_asked_to_use_different_number' }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Not a path anymore.

Suggested change
let(:step) { 'path_where_user_asked_to_use_different_number' }
let(:step) { 'step_where_user_asked_to_use_different_number' }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I caught that, too! 😄

@solipet solipet merged commit 0021580 into main Dec 16, 2021
@solipet solipet deleted the dprice-lg-5259-phone-logging branch December 16, 2021 19:15
jmhooper pushed a commit that referenced this pull request Dec 28, 2021
…r. (LG-5259) (#5719)

* [Logging] Log an event when the user chooses to use a different number. (LG-5259)

* use `step` instead of `location`

* update spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants