Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Jul 12, 2025

WOOMOB-788
pdfdoF-7Bv-p2

Description

Added analytics tracking for barcode scanner setup flow in POS. Implements a dozen new events to track user interaction with scanner selection, setup steps, test scanning, and dismissal behavior.

Registered events

  • TBD - events will be registered before the merge

Steps to reproduce

  1. Launch the app and POS
  2. Select Menu -> Barcode scanner
  3. Navigate the flow in various ways to confirm the behavior
  • barcode_scanner_setup_flow_shown
  • barcode_scanner_setup_scanner_selected with scanner: [Star_BSH_20B, Socket_S720, TBC]
  • barcode_scanner_setup_next_tapped with scanner and step: [setup_barcode_hid, setup_barcode_pair, setup_information, setup_products, pairing,
    test_barcode, test_scan_failed, test_scan_timed_out, setup_complete] (current step before the navigation)
  • barcode_scanner_setup_back_tapped with scanner and step
  • barcode_scanner_setup_open_system_settings_tapped with scanner
  • barcode_scanner_setup_test_scan_success with scanner
  • barcode_scanner_setup_test_scan_failed with scanner and scan_value
  • barcode_scanner_setup_test_scan_timed_out with scanner
  • barcode_scanner_setup_dismissed with scanner and step (tracked from tapping x, tapping outside the modal, and tapping any Close button in the flow). No properties in the initial scanner selection view.
  • barcode_scanner_setup_retry_tapped with scanner

Testing information

Tested on iPad Air 26.0 with Inateck scanner

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

staskus added 6 commits July 12, 2025 12:40
- Add 11 new barcode scanner setup events to WooAnalyticsStat
- Add events to POS event list in TracksProvider
- Add factory methods in WooAnalyticsEvent+PointOfSale
- Add analyticsName to PointOfSaleBarcodeScannerType
- Add PointOfSaleBarcodeScannerSetupStepType enum with analyticsValue
- Update scan tester to use callbacks with scan value parameter
- Track scanner selection, navigation, and completion events
- Track dismissals except on completion step
- Track keyboard connection during setup
- Track system settings button taps
- Add dismissal tracking via onDisappear in main setup view
- Update Xcode project file for new test files
- Update ScanTester tests for new callback structure
- Add FlowManager tests for analytics tracking and state management
- Test dismissal tracking behavior and completion step logic
- Change Result<String, Error> to Result<String, HIDBarcodeParserError> throughout barcode scanning chain
- Update GameControllerBarcodeParser.asResult to return specific error type
- Update scan tester to handle specific error type with error.barcode property
- Update tests to use HIDBarcodeParserError instead of generic TestError
@staskus staskus added this to the 22.9 milestone Jul 12, 2025
@staskus staskus added category: tracks Related to analytics, including Tracks Events. feature: POS labels Jul 12, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jul 12, 2025

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 12, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr15907-20bee21
Version22.8
Bundle IDcom.automattic.alpha.woocommerce
Commit20bee21
Installation URL1buhbqjt39f4g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@staskus staskus requested review from iamgabrielma and jaclync July 14, 2025 09:17
@staskus
Copy link
Contributor Author

staskus commented Jul 14, 2025

@jaclync, @iamgabrielma not sure if anyone has a capability to test this with any barcode scanner?

@staskus staskus marked this pull request as draft July 14, 2025 09:33
@staskus
Copy link
Contributor Author

staskus commented Jul 14, 2025

I will review and integrate existing project PRs first #15903

@iamgabrielma
Copy link
Contributor

My scanner has arrived today, I should be able to set it up/test between today and tomorrow 👍

@jaclync
Copy link
Contributor

jaclync commented Jul 14, 2025

not sure if anyone has a capability to test this with any barcode scanner?

My Tera scanner is scheduled to arrive today (Monday), but not sure what time, and it might take some time for me to set up for the first time. If I receive it today, I can test it tomorrow/Tuesday for sure.

@staskus staskus marked this pull request as ready for review July 14, 2025 14:44
@iamgabrielma
Copy link
Contributor

👋 @staskus I started to test the events with the Eyoyo model (Other). I'm not sure if I'm missing something here, is it possible that some events are not implemented yet, or need a specific scanner for testing the flow? Do I need to go through the pairing flow through the app somehow, rather than directly via iPad settings? Marked them below:

✅ barcode_scanner_setup_flow_shown
✅ barcode_scanner_setup_scanner_selected with scanner: [Star_BSH_20B, Socket_S720, TBC]
✅ barcode_scanner_setup_next_tapped with scanner and step: [setup_barcode_hid, setup_barcode_pair, setup_information, setup_products, pairing, test_barcode, test_scan_failed, test_scan_timed_out, setup_complete] (current step before the navigation)
✅ barcode_scanner_setup_back_tapped with scanner and step
❔ barcode_scanner_setup_open_system_settings_tapped with scanner
❔barcode_scanner_setup_test_scan_success with scanner
❔barcode_scanner_setup_test_scan_failed with scanner and scan_value
❔barcode_scanner_setup_test_scan_timed_out with scanner
✅ barcode_scanner_setup_dismissed with scanner and step (tracked from tapping x, tapping outside the modal, and tapping any Close button in the flow). No properties in the initial scanner selection view.
❔barcode_scanner_setup_retry_tapped with scanner
❔barcode_scanner_setup_complete with scanner

@staskus
Copy link
Contributor Author

staskus commented Jul 15, 2025

@iamgabrielma sorry for not providing more details.

So far, only Star scanner flow is implemented to test all the steps. But you can use Eyoyo to go through the steps as well, just don't scan the QR code.

  1. Select Star
  2. Click next to open the pairing screen
  3. Tap the settings button, barcode_scanner_setup_open_system_settings_tapped with scanner should be tracked
  4. Click next to open the test barcode screen
  5. Wait 10 seconds, the timeout screen is shown, barcode_scanner_setup_test_scan_timed_out should be tracked
  6. Scan some other barcode, error screen should be shown, barcode_scanner_setup_test_scan_failed should be tracked
  7. Retry, barcode_scanner_setup_retry_tapped should be tracked
  8. Come back to the test barcode and scan it, barcode_scanner_setup_test_scan_success should be tracked

barcode_scanner_setup_complete was removed, I'll update the test instructions.

Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

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

LGTM! Seeing the success screen after scanning the test code was oddly satisfying 💯

✅ barcode_scanner_setup_flow_shown
✅ barcode_scanner_setup_scanner_selected with scanner: [Star_BSH_20B, Socket_S720, TBC]
✅ barcode_scanner_setup_next_tapped
✅ barcode_scanner_setup_back_tapped with scanner and step
✅ barcode_scanner_setup_open_system_settings_tapped with scanner
✅ barcode_scanner_setup_test_scan_success with scanner
✅ barcode_scanner_setup_test_scan_failed with scanner and scan_value
✅ barcode_scanner_setup_test_scan_timed_out with scanner
✅ barcode_scanner_setup_dismissed with scanner and step
✅ barcode_scanner_setup_retry_tapped with scanner

Also I saw an additional event being tracked: pos_barcode_scanning_explanation_dialog_shown 👍

case .socketS720:
return [
.start: createWelcomeStep(title: "Socket S720 Setup")
.setupBarcodeHID: createWelcomeStep(title: "Socket S720 Setup")
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily in this PR, but I'm guessing these will need localization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we have WOOMOB-792 for localized strings.

createWelcomeStep also will be removed altogether when we make the setup steps for all the recommended scanners.

@iamgabrielma
Copy link
Contributor

So far, only Star scanner flow is implemented to test all the steps

Ah, thanks! When I didn't see any steps I did tap on Socket, but this only showed the TODO, I didn't check other options.

@staskus staskus enabled auto-merge July 15, 2025 10:31
@staskus
Copy link
Contributor Author

staskus commented Jul 15, 2025

pointOfSaleBarcodeScanningExplanationDialogShown

We can keep it for now. We may remove it when cleaning up the code after i2 🤔

@staskus staskus merged commit bf55b57 into trunk Jul 15, 2025
13 checks passed
@staskus staskus deleted the woomob-788-woo-posbarcodes-analytics-for-setup-flow branch July 15, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events. feature: POS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants