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
10 changes: 8 additions & 2 deletions lib/reporting/drop_off_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ def query
name
, properties.user_id AS user_id
, coalesce(properties.event_properties.success, 0) AS success
, coalesce(properties.event_properties.fraud_review_pending, 0) AS fraud_review_pending
, coalesce(properties.event_properties.gpo_verification_pending, 0) AS gpo_verification_pending
, coalesce(properties.event_properties.in_person_verification_pending, 0) AS in_person_verification_pending
, ispresent(properties.event_properties.deactivation_reason) AS has_other_deactivation_reason
, !fraud_review_pending and !gpo_verification_pending and !in_person_verification_pending and !has_other_deactivation_reason AS identity_verified
Comment on lines +391 to +395
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you update the specs with examples of a few of these fields coming back in the response?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks for the reminder!

#{issuers.present? ? '| filter properties.service_provider IN %{issuers}' : ''}
| filter name in %{event_names}
| limit 10000
Expand All @@ -403,9 +408,10 @@ def data
end

fetch_results.each do |row|
event_users[row['name']] << row['user_id']

event = row['name']
user_id = row['user_id']
event_users[event] << user_id

case event
when Events::IDV_FINAL_RESOLUTION
if row['identity_verified'] == '1'
Expand Down
73 changes: 61 additions & 12 deletions spec/lib/reporting/drop_off_report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{ 'user_id' => 'user1', 'name' => 'idv_enter_password_visited' },
{ 'user_id' => 'user1', 'name' => 'idv_enter_password_submitted' },
{ 'user_id' => 'user1', 'name' => 'IdV: personal key submitted' },
{ 'user_id' => 'user1', 'identity_verified' => '1', 'name' => 'IdV: final resolution' },

# gets through phone finder, then drops
{ 'user_id' => 'user2', 'name' => 'IdV: doc auth welcome visited' },
Expand Down Expand Up @@ -50,6 +51,54 @@
# bails after viewing the user agreement
{ 'user_id' => 'user5', 'name' => 'IdV: doc auth welcome visited' },
{ 'user_id' => 'user5', 'name' => 'IdV: doc auth welcome submitted' },

# finishes funnel but has to wait for GPO letter
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth welcome visited' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth welcome submitted' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth image upload vendor submitted' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth document_capture visited' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth ssn visited' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth verify visited' },
{ 'user_id' => 'user6', 'name' => 'IdV: doc auth verify submitted' },
{ 'user_id' => 'user6',
'gpo_verification_pending' => '1',
'name' => 'IdV: phone of record visited' },
{ 'user_id' => 'user6', 'name' => 'idv_enter_password_visited' },
{ 'user_id' => 'user6', 'name' => 'idv_enter_password_submitted' },
{ 'user_id' => 'user6', 'name' => 'IdV: personal key submitted' },
{ 'user_id' => 'user6', 'identity_verified' => '0', 'name' => 'IdV: final resolution' },

# finishes funnel but has to wait for IPP
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth welcome visited' },
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth welcome submitted' },
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth image upload vendor submitted' },
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth document_capture visited' },
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth ssn visited' },
{ 'user_id' => 'user7', 'name' => 'IdV: doc auth verify visited' },
{ 'user_id' => 'user7',
'in_person_verification_pending' => '1',
'name' => 'IdV: doc auth verify submitted' },
{ 'user_id' => 'user7', 'name' => 'IdV: phone of record visited' },
{ 'user_id' => 'user7', 'name' => 'idv_enter_password_visited' },
{ 'user_id' => 'user7', 'name' => 'idv_enter_password_submitted' },
{ 'user_id' => 'user7', 'name' => 'IdV: personal key submitted' },
{ 'user_id' => 'user7', 'name' => 'IdV: final resolution' },

# finishes funnel but has to wait for fraud review
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth welcome visited' },
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth welcome submitted' },
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth image upload vendor submitted' },
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth document_capture visited' },
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth ssn visited' },
{ 'user_id' => 'user8', 'name' => 'IdV: doc auth verify visited' },
{ 'user_id' => 'user8',
'fraud_review_pending' => '1',
'name' => 'IdV: doc auth verify submitted' },
{ 'user_id' => 'user8', 'name' => 'IdV: phone of record visited' },
{ 'user_id' => 'user8', 'name' => 'idv_enter_password_visited' },
{ 'user_id' => 'user8', 'name' => 'idv_enter_password_submitted' },
{ 'user_id' => 'user8', 'name' => 'IdV: personal key submitted' },
{ 'user_id' => 'user8', 'name' => 'IdV: final resolution' },
],
)

Expand Down Expand Up @@ -144,18 +193,18 @@ def expected_tables(strings: false)
[
['Step', 'Unique user count', 'Users lost', 'Dropoff from last step',
'Users left from start'],
['Welcome (page viewed)'] + string_or_num(strings, 5),
['User agreement (page viewed)'] + string_or_num(strings, 5, 0, 0.0, 1.0),
['Capture Document (page viewed)'] + string_or_num(strings, 4, 1, 0.2, 0.8),
['Document submitted (event)'] + string_or_num(strings, 4, 0, 0.0, 0.8),
['SSN (page view)'] + string_or_num(strings, 3, 1, 0.25, 0.6),
['Verify Info (page view)'] + string_or_num(strings, 2, 1, 0.3333333333333333, 0.4),
['Verify submit (event)'] + string_or_num(strings, 2, 0, 0.0, 0.4),
['Phone finder (page view)'] + string_or_num(strings, 2, 0, 0.0, 0.4),
['Encrypt account: enter password (page view)'] + string_or_num(strings, 1, 1, 0.5, 0.2),
['Personal key input (page view)'] + string_or_num(strings, 1, 0, 0.0, 0.2),
['Verified (event)'] + string_or_num(strings, 1, 0, 0.0, 0.2),
['Workflow Complete - Total Pending'] + string_or_num(strings, 0),
['Welcome (page viewed)'] + string_or_num(strings, 8),
['User agreement (page viewed)'] + string_or_num(strings, 8, 0, 0.0, 1.0),
['Capture Document (page viewed)'] + string_or_num(strings, 7, 1, 0.125, 0.875),
['Document submitted (event)'] + string_or_num(strings, 7, 0, 0.0, 0.875),
['SSN (page view)'] + string_or_num(strings, 6, 1, 1.0 / 7, 0.75),
['Verify Info (page view)'] + string_or_num(strings, 5, 1, 1.0 / 6, 0.625),
['Verify submit (event)'] + string_or_num(strings, 5, 0, 0.0, 0.625),
['Phone finder (page view)'] + string_or_num(strings, 5, 0, 0.0, 0.625),
['Encrypt account: enter password (page view)'] + string_or_num(strings, 4, 1, 0.2, 0.5),
['Personal key input (page view)'] + string_or_num(strings, 4, 0, 0.0, 0.5),
['Verified (event)'] + string_or_num(strings, 4, 0, 0.0, 0.5),
['Workflow Complete - Total Pending'] + string_or_num(strings, 3),
],
]
end
Expand Down