Skip to content

Refactor IdV analytics#790

Merged
monfresh merged 1 commit intomasterfrom
mb-analytics-cleanup
Dec 1, 2016
Merged

Refactor IdV analytics#790
monfresh merged 1 commit intomasterfrom
mb-analytics-cleanup

Conversation

@monfresh
Copy link
Contributor

@monfresh monfresh commented Nov 29, 2016

Why:

  • To better track IdV analytics. Previously, we were only tracking
    failures in the KBV scenario.

How:

  • Add an analytics call to ReviewController to track success and
    failure for the initial IdV submission (prior to KBV and/or phone
    confirmation)
  • Move most of the code in ConfirmationsController to
    QuestionsController since it only applies when KBV is on
  • Check if KBV is on in QuestionsController#index. If not, redirect
    directly to ConfirmationsController. Previously, we were checking if
    questions were available even when KBV was turned off.
  • Add an analytics call in QuestionsController to track success and
    failure when KBV is on
  • Only call analytics in ConfirmationsController if KBV is off to
    prevent duplicate events when KBV is on.
    commit 378a1c191f3d7d342bdf4295153c6fa271fad9ec

Copy link
Contributor

@jessieay jessieay left a comment

Choose a reason for hiding this comment

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

Two minor comments from me. Looks good!

Copy link
Contributor

Choose a reason for hiding this comment

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

Might consider putting these "other cleanup" bits in a separate commit or even separate PR to keep refactor and cleanup separate in git history

Copy link
Contributor

Choose a reason for hiding this comment

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

👏 much better!

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm. maybe we don't have proper test coverage around this, but I believe the or condition is necessary for re-entry of the idv flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you be more specific, please? What does re-entry mean in this scenario?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question.

As I read Idv::PhoneForm.update_idv_params it seems like this check is, indeed, superfluous. I think what I was originally imagining was the edge case where the 2fa phone number was set but not confirmed (somehow) on the User. I don't think it is possible to reach the IdV process, though, w/o first having confirmed 2fa, so your change seems ok as-is.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm. maybe we don't have proper test coverage around this, but I believe the or condition is necessary for re-entry of the idv flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

this tracks whether phone confirmation is required, but not whether it succeeded or not.

i.e. IdV is not complete until the phone is confirmed, so maybe we need a second analytics call after that step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, so it looks like there are 2 separate IdV events we need to track. One is whether the initial resolution passed or not (from the Review Controller). The other is whether they completed IdV after this initial resolution, which may or may not involve a phone confirmation, and may or may not involve KBV.

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds right.

The current implementation does this:

whether they completed IdV after this initial resolution, which may or may not involve a phone confirmation, and may or may not involve KBV.

you are essentially adding coverage for whether initial resolution succeeded or not.

@monfresh monfresh force-pushed the mb-analytics-cleanup branch 2 times, most recently from 522a89d to 378a1c1 Compare November 30, 2016 23:33
@monfresh monfresh changed the title Refactor IdV analytics + other analytics cleanup Refactor IdV analytics Nov 30, 2016
@monfresh
Copy link
Contributor Author

PR revised with updated commit message. PTAL.

Copy link
Contributor

@pkarman pkarman left a comment

Choose a reason for hiding this comment

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

I like that you have moved all the KBV actions into the questions controller, rather than splitting them between questions and confirmations.

Just one naming suggestion, otherwise lgtm.

Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about renaming submit_answers because it no longer actually submits? The actual submission happens in the track_kbv_event and all submit_answers does is handle the response.

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 thinking about that. I'll make it better.

@monfresh
Copy link
Contributor Author

monfresh commented Dec 1, 2016

@pkarman Fixed in 46eef5d.

**Why**:
- To better track IdV analytics. Previously, we were only tracking
failures in the KBV scenario.

**How**:
- Add an analytics call to ReviewController to track success and
failure for the initial IdV submission (prior to KBV and/or phone
confirmation)
- Move most of the code in ConfirmationsController to
QuestionsController since it only applies when KBV is on
- Check if KBV is on in QuestionsController#index. If not, redirect
directly to ConfirmationsController. Previously, we were checking if
questions were available even when KBV was turned off.
- Add an analytics call in QuestionsController to track success and
failure when KBV is on
- Only call analytics in ConfirmationsController if KBV is off to
prevent duplicate events when KBV is on.
@monfresh monfresh force-pushed the mb-analytics-cleanup branch from 46eef5d to 7a8f8ef Compare December 1, 2016 19:29
@monfresh monfresh merged commit 27587cb into master Dec 1, 2016
@monfresh monfresh deleted the mb-analytics-cleanup branch December 1, 2016 19:38
amoose pushed a commit that referenced this pull request Feb 24, 2017
**Why**:
- To better track IdV analytics. Previously, we were only tracking
failures in the KBV scenario.

**How**:
- Add an analytics call to ReviewController to track success and
failure for the initial IdV submission (prior to KBV and/or phone
confirmation)
- Move most of the code in ConfirmationsController to
QuestionsController since it only applies when KBV is on
- Check if KBV is on in QuestionsController#index. If not, redirect
directly to ConfirmationsController. Previously, we were checking if
questions were available even when KBV was turned off.
- Add an analytics call in QuestionsController to track success and
failure when KBV is on
- Only call analytics in ConfirmationsController if KBV is off to
prevent duplicate events when KBV is on.
amoose pushed a commit that referenced this pull request Feb 28, 2017
**Why**:
- To better track IdV analytics. Previously, we were only tracking
failures in the KBV scenario.

**How**:
- Add an analytics call to ReviewController to track success and
failure for the initial IdV submission (prior to KBV and/or phone
confirmation)
- Move most of the code in ConfirmationsController to
QuestionsController since it only applies when KBV is on
- Check if KBV is on in QuestionsController#index. If not, redirect
directly to ConfirmationsController. Previously, we were checking if
questions were available even when KBV was turned off.
- Add an analytics call in QuestionsController to track success and
failure when KBV is on
- Only call analytics in ConfirmationsController if KBV is off to
prevent duplicate events when KBV is on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants