Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-12657: Make Idv::AnalyticsEventsEnhancer opt-out #10230

Closed
Closed
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
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require:
- rubocop-rspec
- rubocop-performance
- ./lib/linters/analytics_event_name_linter.rb
- ./lib/linters/enhanced_idv_events_linter.rb
- ./lib/linters/localized_validation_message_linter.rb
- ./lib/linters/image_size_linter.rb
- ./lib/linters/mail_later_linter.rb
Expand Down Expand Up @@ -61,6 +62,11 @@ IdentityIdp/UrlOptionsLinter:
Exclude:
- 'spec/**/*.rb'

IdentityIdp/EnhancedIdvEventsLinter:
Enabled: true
Include:
- 'app/services/analytics_events.rb'

IdentityIdp/ErrorsAddLinter:
Enabled: true
Exclude:
Expand Down
60 changes: 38 additions & 22 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def idv_acuant_sdk_loaded(
success:,
use_alternate_sdk:,
liveness_checking_required:,
**_extra
**extra
Copy link
Member Author

Choose a reason for hiding this comment

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

There were a few methods that accepted **extra but didn't pass it on to track_event. I've updated those to pass data properly.

)
track_event(
'Frontend: IdV: Acuant SDK loaded',
Expand All @@ -635,6 +635,7 @@ def idv_acuant_sdk_loaded(
success: success,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
**extra,
)
end
# rubocop:enable Naming/VariableName,Naming/MethodParameterName
Expand Down Expand Up @@ -665,8 +666,8 @@ def idv_address_submitted(
end

# User visited idv address page
def idv_address_visit
track_event('IdV: address visited')
def idv_address_visit(**extra)
matthinz marked this conversation as resolved.
Show resolved Hide resolved
track_event('IdV: address visited', **extra)
end

# @param [String] acuantCaptureMode
Expand Down Expand Up @@ -723,7 +724,7 @@ def idv_back_image_added(
use_alternate_sdk:,
liveness_checking_required:,
width:,
**_extra
**extra
)
track_event(
'Frontend: IdV: back image added',
Expand Down Expand Up @@ -752,6 +753,7 @@ def idv_back_image_added(
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
width: width,
**extra,
)
end

Expand All @@ -770,7 +772,7 @@ def idv_back_image_clicked(
source:,
use_alternate_sdk:,
liveness_checking_required:,
**_extra
**extra
)
track_event(
'Frontend: IdV: back image clicked',
Expand All @@ -781,23 +783,26 @@ def idv_back_image_clicked(
source: source,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
**extra,
)
end
# rubocop:enable Naming/VariableName,Naming/MethodParameterName

# @param [String] liveness_checking_required Whether or not the selfie is required
def idv_barcode_warning_continue_clicked(liveness_checking_required:, **_extra)
def idv_barcode_warning_continue_clicked(liveness_checking_required:, **extra)
track_event(
'Frontend: IdV: barcode warning continue clicked',
liveness_checking_required: liveness_checking_required,
**extra,
)
end

# @param [String] liveness_checking_required Whether or not the selfie is required
def idv_barcode_warning_retake_photos_clicked(liveness_checking_required:, **_extra)
def idv_barcode_warning_retake_photos_clicked(liveness_checking_required:, **extra)
track_event(
'Frontend: IdV: barcode warning retake photos clicked',
liveness_checking_required: liveness_checking_required,
**extra,
)
end

Expand Down Expand Up @@ -856,7 +861,7 @@ def idv_capture_troubleshooting_dismissed(
flow_path:,
use_alternate_sdk:,
liveness_checking_required:,
**_extra
**extra
)
track_event(
'Frontend: IdV: Capture troubleshooting dismissed',
Expand All @@ -865,6 +870,7 @@ def idv_capture_troubleshooting_dismissed(
flow_path: flow_path,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
**extra,
)
end

Expand Down Expand Up @@ -954,10 +960,11 @@ def idv_doc_auth_link_sent_visited(**extra)
track_event('IdV: doc auth link_sent visited', **extra)
end

def idv_doc_auth_randomizer_defaulted
def idv_doc_auth_randomizer_defaulted(**extra)
track_event(
'IdV: doc_auth random vendor error',
error: 'document_capture_session_uuid_key missing',
**extra,
)
end

Expand Down Expand Up @@ -1275,7 +1282,7 @@ def idv_exit_optional_questions(
flow_path:,
ids:,
use_alternate_sdk:,
**_extra
**extra
)
track_event(
'Frontend: IdV: exit optional questions',
Expand All @@ -1284,6 +1291,7 @@ def idv_exit_optional_questions(
flow_path: flow_path,
ids: ids,
use_alternate_sdk: use_alternate_sdk,
**extra,
)
end

Expand Down Expand Up @@ -1394,7 +1402,7 @@ def idv_front_image_added(
use_alternate_sdk:,
liveness_checking_required:,
width:,
**_extra
**extra
)
track_event(
'Frontend: IdV: front image added',
Expand Down Expand Up @@ -1423,6 +1431,7 @@ def idv_front_image_added(
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
width: width,
**extra,
)
end

Expand All @@ -1441,7 +1450,7 @@ def idv_front_image_clicked(
source:,
use_alternate_sdk:,
liveness_checking_required: nil,
**_extra
**extra
)
track_event(
'Frontend: IdV: front image clicked',
Expand All @@ -1452,6 +1461,7 @@ def idv_front_image_clicked(
source: source,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
**extra,
)
end
# rubocop:enable Naming/VariableName,Naming/MethodParameterName
Expand Down Expand Up @@ -1565,7 +1575,7 @@ def idv_image_capture_failed(
acuant_version:,
flow_path:,
use_alternate_sdk:,
**_extra
**extra
)
track_event(
'Frontend: IdV: Image capture failed',
Expand All @@ -1576,6 +1586,7 @@ def idv_image_capture_failed(
acuant_version: acuant_version,
flow_path: flow_path,
use_alternate_sdk: use_alternate_sdk,
**extra,
)
end
# rubocop:enable Naming/VariableName,Naming/MethodParameterName
Expand Down Expand Up @@ -2391,8 +2402,8 @@ def idv_in_person_usps_request_enroll_exception(
end

# User visits IdV
def idv_intro_visit
track_event('IdV: intro visited')
def idv_intro_visit(**extra)
track_event('IdV: intro visited', **extra)
end

# @param [String] enrollment_id
Expand Down Expand Up @@ -2425,20 +2436,22 @@ def idv_letter_enqueued_visit(proofing_components: nil, **extra)
def idv_link_sent_capture_doc_polling_complete(
isCancelled:,
isRateLimited:,
**_extra
**extra
)
track_event(
'Frontend: IdV: Link sent capture doc polling complete',
isCancelled: isCancelled,
isRateLimited: isRateLimited,
**extra,
)
end

# rubocop:enable Naming/VariableName,Naming/MethodParameterName

def idv_link_sent_capture_doc_polling_started(**_extra)
def idv_link_sent_capture_doc_polling_started(**extra)
track_event(
'Frontend: IdV: Link sent capture doc polling started',
**extra,
)
end

Expand Down Expand Up @@ -2497,8 +2510,8 @@ def idv_native_camera_forced(
end

# Tracks when user reaches verify errors due to being rejected due to fraud
def idv_not_verified_visited
track_event('IdV: Not verified visited')
def idv_not_verified_visited(**extra)
track_event('IdV: Not verified visited', **extra)
end

# Tracks if a user clicks the 'acknowledge' checkbox during personal
Expand Down Expand Up @@ -2934,7 +2947,7 @@ def idv_selfie_image_added(
source:,
liveness_checking_required:,
width:,
**_extra
**extra
)
track_event(
:idv_selfie_image_added,
Expand All @@ -2948,6 +2961,7 @@ def idv_selfie_image_added(
source: source,
liveness_checking_required: liveness_checking_required,
width: width,
**extra,
)
end
# rubocop:enable Naming/VariableName,Naming/MethodParameterName
Expand Down Expand Up @@ -3099,7 +3113,7 @@ def idv_warning_action_triggered(
flow_path:,
location:,
use_alternate_sdk:,
**_extra
**extra
)
track_event(
'Frontend: IdV: warning action triggered',
Expand All @@ -3108,6 +3122,7 @@ def idv_warning_action_triggered(
flow_path: flow_path,
location: location,
use_alternate_sdk: use_alternate_sdk,
**extra,
)
end

Expand All @@ -3132,7 +3147,7 @@ def idv_warning_shown(
subheading:,
use_alternate_sdk:,
liveness_checking_required:,
**_extra
**extra
)
track_event(
'Frontend: IdV: warning shown',
Expand All @@ -3146,6 +3161,7 @@ def idv_warning_shown(
subheading: subheading,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
**extra,
)
end

Expand Down
Loading