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

[Woo POS] MVP Analytics: Update receipt-related events #15204

Merged
merged 6 commits into from
Feb 20, 2025

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Feb 19, 2025

Closes: #15203

Description

This PR updates receipt-related events by:

  • Updates old pos_email_receipt_tapped for new pos_receipt_email_tapped
  • Updates old pos_email_receipt_send_tapped for new pos_receipt_email_send_tapped
  • Adds pos_receipt_email_success, triggered on receipt success
  • Adds pos_receipt_email_failed, triggered on receipt failure
  • Removes sendReceiptsForPointOfSale feature flag.

In POS, go through the payment flow until you reach the success view. Then:

Testing information

Tap "Email receipt":

🔵 Tracked pos_receipt_email_tapped, properties: [plan: , site_url: https://indiemelon.mystagingwebsite.com, store_id: c5bd46cc-1804-4f7b-badb-bb98c449127f, was_ecommerce_trial: false, is_wpcom_store: false, blog_id: -1]

Tap the Send button

🔵 Tracked pos_receipt_email_send_tapped, properties: [blog_id: -1, was_ecommerce_trial: false, site_url: https://indiemelon.mystagingwebsite.com, is_wpcom_store: false, store_id: c5bd46cc-1804-4f7b-badb-bb98c449127f, plan: ]

Enter a valid email, and send it:

🔵 Tracked pos_receipt_email_success, properties: [site_url: https://indiemelon.mystagingwebsite.com, plan: , was_ecommerce_trial: false, store_id: c5bd46cc-1804-4f7b-badb-bb98c449127f, is_wpcom_store: false, blog_id: -1]

Re-run the app and repeat but throwing an error from sendReceipt() in the order controller, observe the event being tracked, and the error bubbling up to the view:

    func sendReceipt(recipientEmail: String) async throws {
        throw NSError(domain: "oopsie", code: -1)
        guard let order = order else {
            return
        }
        try await orderService.updatePOSOrder(order: order, recipientEmail: recipientEmail)
        try await receiptService.sendReceipt(order: order, recipientEmail: recipientEmail)
    }
🔵 Tracked pos_receipt_email_failed, properties: [store_id: c5bd46cc-1804-4f7b-badb-bb98c449127f, blog_id: -1, was_ecommerce_trial: false, is_wpcom_store: false, site_url: https://indiemelon.mystagingwebsite.com, plan: ]

Simulator Screenshot - iPad Air 11 - iOS 17 5 M2 (US site) - 2025-02-19 at 14 29 31


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

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@dangermattic
Copy link
Collaborator

dangermattic commented Feb 19, 2025

1 Warning
⚠️ This PR is assigned to the milestone 21.8. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.
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 Feb 19, 2025

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr15204-d3e507f
Version21.7
Bundle IDcom.automattic.alpha.woocommerce
Commitd3e507f
App Center BuildWooCommerce - Prototype Builds #13040
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iamgabrielma iamgabrielma added category: tracks Related to analytics, including Tracks Events. feature: POS type: task An internally driven task. labels Feb 19, 2025
@iamgabrielma iamgabrielma added this to the 21.8 milestone Feb 19, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review February 19, 2025 14:40
@iamgabrielma iamgabrielma requested a review from staskus February 19, 2025 14:58
Copy link
Contributor

@staskus staskus 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! :shipit: 🚀

Base automatically changed from task/15058-pos-events-allowed-list to trunk February 20, 2025 06:04
@iamgabrielma iamgabrielma merged commit 998ca4e into trunk Feb 20, 2025
30 of 33 checks passed
@iamgabrielma iamgabrielma deleted the task/15203-pos-receipt-events branch February 20, 2025 06:06
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 type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] MVP Analytics: Update receipt-related events
4 participants