Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Jun 16, 2025

WOOPRD-566
Android task: woocommerce/woocommerce-android#14177

Description

Add tracking for barcode scanning to match Android:

  1. Extend pos_item_added_to_cart event:
    -item_type with loading and error values
    -source_type with a scanner value
  • error with an error message in case of failed scan
  1. Extend pos_item_removed_from_cart event:
  • item_type with loading and error values

Steps to reproduce

Valid simple product

  1. Scan a valid product
  2. Confirm pos_item_added_to_cart is tracked with item_type: loading and source_type: scanner
  3. When the product loads, confirm pos_item_added_to_cart is tracked with item_type: product, product_type: simple and source_type: scanner
  4. Remove, confirm pos_item_removed_from_cart is tracked with the same attributes

Valid variation

  1. Scan a valid variation
  2. Confirm pos_item_added_to_cart is tracked with item_type: loading and source_type: scanner
  3. When the product loads, confirm pos_item_added_to_cart is tracked with item_type: product, product_type: variation and source_type: scanner
  4. Remove, confirm pos_item_removed_from_cart is tracked with the same attributes

Invalid

  1. Scan an invalid barcode
  2. Confirm pos_item_added_to_cart is tracked with item_type: loading and source_type: scanner
  3. When the error appears, confirm pos_item_added_to_cart is tracked with item_type: error, source_type: scanner and error containing an error message
  4. Remove, confirm pos_item_removed_from_cart is tracked with item_type: error, source: cart

Loading

  1. Scan an invalid barcode
  2. Confirm pos_item_added_to_cart is tracked with item_type: loading and source_type: scanner
  3. Remove before loading has finished
  4. Confirm pos_item_removed_from_cart is tracked with item_type: loading, source: cart

Testing information

Tested with iPad Air M2 18.3 Device


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

staskus added 4 commits June 16, 2025 16:52
- Expand source_type with scanner
- Expand item_type with loading and error types
- Add new error field

Track loading, error, and success scanner states
@staskus staskus added this to the 22.7 milestone Jun 16, 2025
@staskus staskus requested a review from joshheald June 16, 2025 15:23
@staskus staskus added type: task An internally driven task. feature: POS labels Jun 16, 2025
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 16, 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 Number30569
VersionPR #15758
Bundle IDcom.automattic.alpha.woocommerce
Commitcbc63cd
Installation URL7fd24pncd24o0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@joshheald joshheald self-assigned this Jun 17, 2025
Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

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

Works well, one suggestion for improvement by tracking the whole error.

@staskus staskus enabled auto-merge June 18, 2025 15:53
@staskus staskus merged commit a54cd3e into trunk Jun 18, 2025
13 checks passed
@staskus staskus deleted the wooprd-566-woo-posbarcodes-analytics-tracking-for-barcode-scanning branch June 18, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants