Skip to content

Commit 363e0b0

Browse files
committed
Add a new checkout_cash_payment_tapped POS event and track it when the merchant taps on cash payment from the checkout screen. Move the existing cash_payment_tapped event to be tracked when marking cash payment as completed.
1 parent 09438f3 commit 363e0b0

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

WooCommerce/Classes/Analytics/TracksProvider.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ private extension TracksProvider {
139139
WooAnalyticsStat.pointOfSaleViewDocsTapped,
140140
WooAnalyticsStat.pointOfSaleReaderReadyForCardPayment,
141141
WooAnalyticsStat.pointOfSaleCashCollectPaymentSuccess,
142+
WooAnalyticsStat.pointOfSaleCheckoutCashPaymentTapped,
142143
WooAnalyticsStat.pointOfSaleCashPaymentTapped,
143144
WooAnalyticsStat.pointOfSaleCashPaymentFailed,
144145
WooAnalyticsStat.pointOfSaleItemsHeaderTapped,

WooCommerce/Classes/Analytics/WooAnalyticsStat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,7 @@ enum WooAnalyticsStat: String {
12571257
case pointOfSaleItemRemovedFromCart = "item_removed_from_cart"
12581258
case pointOfSaleCheckoutTapped = "checkout_tapped"
12591259
case pointOfSaleBackToCartTapped = "back_to_cart_tapped"
1260+
case pointOfSaleCheckoutCashPaymentTapped = "checkout_cash_payment_tapped"
12601261
case pointOfSaleCashPaymentTapped = "cash_payment_tapped"
12611262
case pointOfSaleCashPaymentFailed = "cash_payment_failed"
12621263
case pointOfSaleBackToCheckoutFromCashTapped = "back_to_checkout_from_cash"

WooCommerce/Classes/POS/Models/PointOfSaleAggregateModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ extension PointOfSaleAggregateModel {
368368
// Once we get the callback from the card service, we switch to cash collection state
369369
@MainActor
370370
func startCashPayment() async {
371-
analytics.track(.pointOfSaleCashPaymentTapped)
371+
analytics.track(.pointOfSaleCheckoutCashPaymentTapped)
372372
try? await cardPresentPaymentService.cancelPayment()
373373
paymentState.cash = .collectingCash
374374
}

WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ struct PointOfSaleCollectCashView: View {
121121

122122
private extension PointOfSaleCollectCashView {
123123
private func submitCashAmount() async {
124+
ServiceLocator.analytics.track(.pointOfSaleCashPaymentTapped)
124125
guard validateAmountOnSubmit() else {
125126
return
126127
}

0 commit comments

Comments
 (0)