LG-11631: Add front end logging for selfie capture#9795
LG-11631: Add front end logging for selfie capture#9795night-jellyfish merged 9 commits intomainfrom
Conversation
spec/javascript/packages/document-capture/components/acuant-capture-spec.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I wasn't sure if it would be better to only list this comment once and write something like see test for "OnSelfieCaptureOpen" above for more info. But I thought if the code changed, we could easily lose the main comment, while still referencing it in other comments, so I thought in this case it was better to leave it repeated.
There was a problem hiding this comment.
Yeah, I agree with your concern about the code changing and causing see test for "OnSelfieCaptureOpen" above for more info to lose its meaning. I'm good with the repeat.
spec/features/idv/analytics_spec.rb
Outdated
There was a problem hiding this comment.
This test, as it stands, can only test the desktop flow and cannot test SDK interaction. We don't seem to have a way to test / mock SDK interaction on the back end (and as I found, other "SDK-only" events like Acuant SDK loaded were not found in this file). This prevents us from testing the whole flow from front --> back. I plan to make a ticket for this.
There was a problem hiding this comment.
app/javascript/packages/document-capture/components/acuant-capture.tsx
Outdated
Show resolved
Hide resolved
app/javascript/packages/document-capture/components/acuant-capture.tsx
Outdated
Show resolved
Hide resolved
app/javascript/packages/document-capture/components/acuant-capture.tsx
Outdated
Show resolved
Hide resolved
app/javascript/packages/document-capture/components/acuant-capture.tsx
Outdated
Show resolved
Hide resolved
We may eventually want to send more metadata of the selfie image as well, but it is not currently available. So sending the metadata was determined out of scope, and looked at in future work. Co-authored-by: Charles Ferguson <charles.ferguson@gsa.gov>
- idv_sdk_selfie_image_capture_closed_without_photo - idv_sdk_selfie_image_capture_failed - idv_sdk_selfie_image_capture_opened
This event will only fire on selfie image upload, not on SDK interaction. For the metadata coming through on the event, I mostly modeled the data I saw coming through for the front and back doc auth images, and then removed some items that I didn't see data coming through for. Unsure if that was the right way to go about it. In addition, this is the only "selfie" event we can currently test on the backend, so that is why it's the only one included in `analytics_spec` for now. We may add a ticket for finding ways to test the other events on the backend, especially since we are unsure if file upload will stay as an option for selfie.
Sometimes you don't see these until a PR is up.
64d9c84 to
830a3cb
Compare
|
Example logs: {
"name": "Frontend (warning): IdV: selfie image clicked",
"properties": {
"event_properties": {
"source": "button",
"isDrop": false,
"flow_path": "standard",
"acuant_sdk_upgrade_a_b_testing_enabled": "false",
"use_alternate_sdk": "false",
"acuant_version": "11.9.1",
"opted_in_to_in_person_proofing": "false"
},
"new_event": true,
"path": "/api/logger",
"session_duration": 214.368293,
"user_id": "26ba4b31-ceb8-4e43-9dec-ace9331013c8",
"locale": "en",
"user_ip": "192.168.86.20",
"hostname": "192.168.86.22",
"pid": 50391,
"service_provider": null,
"trace_id": null,
"git_sha": "830a3cba",
"git_branch": "lg-11631-add-fe-logging-for-selfie-capture",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
"browser_name": "Safari",
"browser_version": "16.6",
"browser_platform_name": "iOS (iPhone)",
"browser_platform_version": "16.7.2",
"browser_device_name": "iPhone",
"browser_mobile": true,
"browser_bot": false
},
"time": "2023-12-20T14:53:04.368Z",
"id": "05507cf0-1d9b-43e4-ae0c-385dac786eff",
"visitor_id": "4aaef3e3-8c27-434b-b657-cb8365f2521e",
"visit_id": "7ce570ae-0e4b-4572-9d01-7384eb2b4f60",
"log_filename": "events.log"
}
{
"name": "idv_sdk_selfie_image_capture_opened",
"properties": {
"event_properties": {},
"new_event": true,
"path": "/api/logger",
"session_duration": 214.379125,
"user_id": "26ba4b31-ceb8-4e43-9dec-ace9331013c8",
"locale": "en",
"user_ip": "192.168.86.20",
"hostname": "192.168.86.22",
"pid": 50391,
"service_provider": null,
"trace_id": null,
"git_sha": "830a3cba",
"git_branch": "lg-11631-add-fe-logging-for-selfie-capture",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
"browser_name": "Safari",
"browser_version": "16.6",
"browser_platform_name": "iOS (iPhone)",
"browser_platform_version": "16.7.2",
"browser_device_name": "iPhone",
"browser_mobile": true,
"browser_bot": false
},
"time": "2023-12-20T14:53:04.379Z",
"id": "30170d03-2bfe-46c5-838c-6eedf944af94",
"visitor_id": "4aaef3e3-8c27-434b-b657-cb8365f2521e",
"visit_id": "7ce570ae-0e4b-4572-9d01-7384eb2b4f60",
"log_filename": "events.log"
}
{
"name": "idv_sdk_selfie_image_capture_closed_without_photo",
"properties": {
"event_properties": {},
"new_event": true,
"path": "/api/logger",
"session_duration": 240.035688,
"user_id": "26ba4b31-ceb8-4e43-9dec-ace9331013c8",
"locale": "en",
"user_ip": "192.168.86.20",
"hostname": "192.168.86.22",
"pid": 50391,
"service_provider": null,
"trace_id": null,
"git_sha": "830a3cba",
"git_branch": "lg-11631-add-fe-logging-for-selfie-capture",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
"browser_name": "Safari",
"browser_version": "16.6",
"browser_platform_name": "iOS (iPhone)",
"browser_platform_version": "16.7.2",
"browser_device_name": "iPhone",
"browser_mobile": true,
"browser_bot": false
},
"time": "2023-12-20T14:53:30.036Z",
"id": "4d060239-c761-42aa-aeaa-56de3ececa02",
"visitor_id": "4aaef3e3-8c27-434b-b657-cb8365f2521e",
"visit_id": "7ce570ae-0e4b-4572-9d01-7384eb2b4f60",
"log_filename": "events.log"
} |
| * Failure callback | ||
| */ | ||
| onImageCaptureFailure: any; | ||
| onImageCaptureFailure: (error: { code: number; message: string }) => void; |
There was a problem hiding this comment.
Yeah, I agree with your concern about the code changing and causing see test for "OnSelfieCaptureOpen" above for more info to lose its meaning. I'm good with the repeat.
🎫 Ticket
LG-11631
🛠 Summary of changes
This PR adds 5 logging events:
idv_sdk_selfie_image_capture_opened(mobile only - logs when a user opens the SDK for selfie capture)idv_sdk_selfie_image_capture_closed_without_photo(mobile only - logs when a user starts to take a selfie with the SDK but exits out without adding one)idv_sdk_selfie_image_capture_failed(mobile only - logs when an error happens in the process of adding the selfie via the SDK)idv_sdk_selfie_image_added(mobile only - logs when a user uses the SDK to click the green checkmark and accept their selfie)idv_selfie_image_file_uploaded(desktop only - logs when a user uses the file picker instead of the SDK to add a selfie)📜 Testing Plan
application.yml, setdoc_auth_selfie_capture_enabled: truemake watch_events(or, look atlog/events.log)make watch_eventsstreamCo-authored-by: Charles Ferguson charles.ferguson@gsa.gov