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] M2: Analytics #13277

Open
iamgabrielma opened this issue Jul 9, 2024 · 2 comments
Open

[Woo POS] M2: Analytics #13277

iamgabrielma opened this issue Jul 9, 2024 · 2 comments
Labels
feature: POS type: task An internally driven task.

Comments

@iamgabrielma
Copy link
Contributor

iamgabrielma commented Jul 9, 2024

Since we've abstracted Analytics to a protocol in preparation for M1, we can inject the abstraction through the entry point and then specialize it as needed for our case:

+ final class POSAnalytics: Analytics {  ... }
+ final class DummyPOSAnalyticsProvider: AnalyticsProvider { ... }

struct PointOfSaleEntryPointView: View { ... 

    init(itemProvider: POSItemProvider,
         hideAppTabBar: @escaping ((Bool) -> Void),
         cardPresentPaymentService: CardPresentPaymentFacade,
         orderService: POSOrderServiceProtocol,
         currencyFormatter: CurrencyFormatter,
+         analyticsService: Analytics) {
        self.hideAppTabBar = hideAppTabBar

        _viewModel = StateObject(wrappedValue: PointOfSaleDashboardViewModel(
            itemProvider: itemProvider,
            cardPresentPaymentService: cardPresentPaymentService,
            orderService: orderService,
            currencyFormatter: currencyFormatter, 
+            analyticsService: analyticsService)
        )
    }

TODO:

Task Issue
Create PointOfSaleAnalytics and PointOfSaleTracksProvider #13604
Cart: item_added_to_cart #13604
Order: order_creation_failed #13613
Payment success: card_present_collect_payment_success #13614
Payment failure: card_present_collect_payment_failed #13614
@iamgabrielma iamgabrielma added type: task An internally driven task. feature: POS labels Jul 9, 2024
@dangermattic
Copy link
Collaborator

Thanks for reporting! 👍

@staskus staskus changed the title [Woo POS] M2: Inject Analytics [Woo POS] M2: Analytics Aug 2, 2024
@iamgabrielma
Copy link
Contributor Author

Updated: p91TBi-bNR-p2#comment-12826

We can start with:

Payment Success card_present_collect_payment_success
Payment Flow Error: card_present_collect_payment_failed (error_type: string)
Product Added to Cart: item_added_to_cart
Order Creation Error: order_creation_failed (error_type: string)

Prefix: woocommerceios_pos_*

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

No branches or pull requests

2 participants