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/frontend_log_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class FrontendLogController < ApplicationController
'IdV: personal key acknowledgment toggled' => :idv_personal_key_acknowledgment_toggled,
'IdV: prepare submitted' => :idv_in_person_prepare_submitted,
'IdV: prepare visited' => :idv_in_person_prepare_visited,
'IdV: selfie image clicked' => :idv_selfie_image_clicked,
'IdV: switch_back submitted' => :idv_in_person_switch_back_submitted,
'IdV: switch_back visited' => :idv_in_person_switch_back_visited,
'IdV: user clicked sp link on ready to verify page' => :idv_in_person_ready_to_verify_sp_link_clicked,
Expand All @@ -55,6 +54,7 @@ class FrontendLogController < ApplicationController
idv_sdk_selfie_image_capture_failed
idv_sdk_selfie_image_capture_opened
idv_selfie_image_added
idv_selfie_image_clicked
phone_input_country_changed
].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,15 @@ function AcuantCapture(
return <T extends (...args: any[]) => any>(fn: T) =>
(...args: Parameters<T>) => {
if (!isSuppressingClickLogging.current) {
trackEvent(`IdV: ${name} image clicked`, {
source,
...metadata,
liveness_checking_required: isSelfieCaptureEnabled,
});
trackEvent(
name === 'selfie' ? 'idv_selfie_image_clicked' : `IdV: ${name} image clicked`,
{
source,
...metadata,
liveness_checking_required: isSelfieCaptureEnabled,
captureAttempts,
},
);
}

return fn(...args);
Expand Down
9 changes: 9 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ def idv_back_image_added(
# @param [Boolean] isDrop
# @param [Boolean] source
# @param [Boolean] use_alternate_sdk
# @param [Number] captureAttempts count of image capturing attempts
# @param [String] liveness_checking_required Whether or not the selfie is required
def idv_back_image_clicked(
acuant_sdk_upgrade_a_b_testing_enabled:,
Expand All @@ -771,6 +772,7 @@ def idv_back_image_clicked(
isDrop:,
source:,
use_alternate_sdk:,
captureAttempts:,
liveness_checking_required:,
**extra
)
Expand All @@ -783,6 +785,7 @@ def idv_back_image_clicked(
source: source,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
captureAttempts: captureAttempts,
**extra,
)
end
Expand Down Expand Up @@ -1529,6 +1532,7 @@ def idv_front_image_added(
# @param [Boolean] isDrop
# @param [String] source
# @param [String] use_alternate_sdk
# @param [Number] captureAttempts count of image capturing attempts
# @param [Boolean] liveness_checking_required
def idv_front_image_clicked(
acuant_sdk_upgrade_a_b_testing_enabled:,
Expand All @@ -1537,6 +1541,7 @@ def idv_front_image_clicked(
isDrop:,
source:,
use_alternate_sdk:,
captureAttempts:,
Comment thread
dawei-nava marked this conversation as resolved.
liveness_checking_required: nil,
**extra
)
Expand All @@ -1549,6 +1554,7 @@ def idv_front_image_clicked(
source: source,
use_alternate_sdk: use_alternate_sdk,
liveness_checking_required: liveness_checking_required,
captureAttempts: captureAttempts,
Comment thread
dawei-nava marked this conversation as resolved.
**extra,
)
end
Expand Down Expand Up @@ -3318,6 +3324,7 @@ def idv_selfie_image_added(
# @param [Boolean] isDrop
# @param [String] source
# @param [String] use_alternate_sdk
# @param [Number] captureAttempts
# @param [Boolean] liveness_checking_required
# @param [Hash,nil] proofing_components User's proofing components.
# @param [String,nil] active_profile_idv_level ID verification level of user's active profile.
Expand All @@ -3329,6 +3336,7 @@ def idv_selfie_image_clicked(
isDrop:,
source:,
use_alternate_sdk:,
captureAttempts:,
liveness_checking_required: nil,
proofing_components: nil,
active_profile_idv_level: nil,
Expand All @@ -3343,6 +3351,7 @@ def idv_selfie_image_clicked(
isDrop: isDrop,
source: source,
use_alternate_sdk: use_alternate_sdk,
captureAttempts: captureAttempts,
liveness_checking_required: liveness_checking_required,
proofing_components: proofing_components,
active_profile_idv_level: active_profile_idv_level,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ describe('document-capture/components/acuant-capture', () => {
}),
});

expect(trackEvent).to.be.calledWith('IdV: selfie image clicked');
expect(trackEvent).to.be.calledWith('idv_selfie_image_clicked');
expect(trackEvent).to.be.calledWith('IdV: Acuant SDK loaded');

expect(trackEvent).to.have.been.calledWith('idv_sdk_selfie_image_capture_opened');
Expand All @@ -1193,7 +1193,7 @@ describe('document-capture/components/acuant-capture', () => {
}),
});

expect(trackEvent).to.be.calledWith('IdV: selfie image clicked');
expect(trackEvent).to.be.calledWith('idv_selfie_image_clicked');
expect(trackEvent).to.be.calledWith('IdV: Acuant SDK loaded');

expect(trackEvent).to.have.been.calledWith(
Expand All @@ -1212,7 +1212,7 @@ describe('document-capture/components/acuant-capture', () => {
}),
});

expect(trackEvent).to.be.calledWith('IdV: selfie image clicked');
expect(trackEvent).to.be.calledWith('idv_selfie_image_clicked');
expect(trackEvent).to.be.calledWith('IdV: Acuant SDK loaded');

expect(trackEvent).to.have.been.calledWith(
Expand All @@ -1236,7 +1236,7 @@ describe('document-capture/components/acuant-capture', () => {
}),
});

expect(trackEvent).to.be.calledWith('IdV: selfie image clicked');
expect(trackEvent).to.be.calledWith('idv_selfie_image_clicked');
expect(trackEvent).to.be.calledWith('IdV: Acuant SDK loaded');

expect(trackEvent).to.have.been.calledWith(
Expand Down Expand Up @@ -1402,16 +1402,19 @@ describe('document-capture/components/acuant-capture', () => {
source: 'placeholder',
isDrop: false,
liveness_checking_required: false,
captureAttempts: 1,
});
expect(trackEvent).to.have.been.calledWith('IdV: test image clicked', {
source: 'button',
isDrop: false,
liveness_checking_required: false,
captureAttempts: 1,
});
expect(trackEvent).to.have.been.calledWith('IdV: test image clicked', {
source: 'upload',
isDrop: false,
liveness_checking_required: false,
captureAttempts: 1,
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.

I think that this is enough to test that the idv_selfie_image_clicked is also coming through with the captureAttempts property? Double checking because the only name I see when we're testing captureAttempts is 'IdV: test image clicked'.

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.

Forgot to include - here are some logs from make watch_events

logs.json

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.

@charleyf , you are right idv_selfie_image_clicked not logged, due to event name mismatch. 👍

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.

@charleyf, ok the card mentioned nothing about front or back clicked, added captureAttempts in analytics_event for them.

});
});

Expand All @@ -1432,6 +1435,7 @@ describe('document-capture/components/acuant-capture', () => {
source: 'placeholder',
isDrop: true,
liveness_checking_required: false,
captureAttempts: 1,
});
});

Expand Down