-
Notifications
You must be signed in to change notification settings - Fork 115
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] Analytics: Make allowed event list for POS when decorating #15202
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,25 +110,94 @@ private extension TracksProvider { | |
} | ||
|
||
private func decorateEventNameForPOSIfNeeded(_ eventName: String) -> String { | ||
// We do not want to track some events that might happen in POS mode as `pos_` events, | ||
// for example, when backgrounding the app or finishing async work from the app side. | ||
// Ref: https://github.com/woocommerce/woocommerce-ios/pull/15006#issuecomment-2622001706 | ||
let exemptedEvents: Set<String> = [ | ||
"application_opened", | ||
"application_closed", | ||
"orders_add_new", | ||
"support_new_request_viewed", | ||
"dynamic_dashboard_card_data_loading_completed" | ||
] | ||
if exemptedEvents.contains(eventName) { | ||
guard let event = WooAnalyticsStat(rawValue: eventName) else { | ||
DDLogWarn("⚠️ Event not found in WooAnalyticsStat list") | ||
return eventName | ||
} | ||
|
||
if Self.isPOSModeActive { | ||
let prefix = "pos_" | ||
return "\(prefix)\(eventName)" | ||
let pointOfSaleEventList: Set<WooAnalyticsStat> = [ | ||
// POS-specific events | ||
WooAnalyticsStat.pointOfSaleLoaded, | ||
WooAnalyticsStat.pointOfSaleProductsPullToRefresh, | ||
WooAnalyticsStat.pointOfSaleVariationsPullToRefresh, | ||
WooAnalyticsStat.pointOfSaleAddItemToCart, | ||
WooAnalyticsStat.pointOfSaleItemRemovedFromCart, | ||
WooAnalyticsStat.pointOfSaleCheckoutTapped, | ||
WooAnalyticsStat.pointOfSaleBackToCartTapped, | ||
WooAnalyticsStat.pointOfSaleBackToCheckoutFromCashTapped, | ||
WooAnalyticsStat.pointOfSaleClearCartTapped, | ||
WooAnalyticsStat.pointOfSaleExitMenuItemTapped, | ||
WooAnalyticsStat.pointOfSaleExitConfirmed, | ||
WooAnalyticsStat.pointOfSaleGetSupportTapped, | ||
WooAnalyticsStat.pointOfSaleSimpleProductsExplanationDialogShown, | ||
WooAnalyticsStat.pointOfSaleCreateNewOrderTapped, | ||
WooAnalyticsStat.pointOfSaleEmailReceiptTapped, | ||
WooAnalyticsStat.pointOfSaleEmailReceiptSendTapped, | ||
WooAnalyticsStat.pointOfSalePaymentsOnboardingShown, | ||
WooAnalyticsStat.pointOfSalePaymentsOnboardingDismissed, | ||
WooAnalyticsStat.pointOfSaleCardReaderConnectionTapped, | ||
WooAnalyticsStat.pointOfSaleInteractionWithCustomerStarted, | ||
WooAnalyticsStat.pointOfSaleViewDocsTapped, | ||
WooAnalyticsStat.pointOfSaleReaderReadyForCardPayment, | ||
WooAnalyticsStat.pointOfSaleCashCollectPaymentSuccess, | ||
|
||
// Order | ||
WooAnalyticsStat.orderCreationSuccess, | ||
WooAnalyticsStat.orderCreationFailed, | ||
|
||
// Card Reader Connection | ||
WooAnalyticsStat.cardReaderSelectTypeShown, | ||
WooAnalyticsStat.cardReaderSelectTypeBuiltInTapped, | ||
WooAnalyticsStat.cardReaderSelectTypeBluetoothTapped, | ||
WooAnalyticsStat.cardReaderDiscoveryFailed, | ||
WooAnalyticsStat.cardReaderConnectionFailed, | ||
WooAnalyticsStat.cardReaderConnectionSuccess, | ||
WooAnalyticsStat.cardReaderDisconnectTapped, | ||
WooAnalyticsStat.manageCardReadersBuiltInReaderAutoDisconnect, | ||
WooAnalyticsStat.cardReaderAutomaticDisconnect, | ||
WooAnalyticsStat.cardReaderLocationPermissionPreAlertShown, | ||
WooAnalyticsStat.cardReaderLocationPermissionRequiredShown, | ||
|
||
// Card Reader Software Update | ||
WooAnalyticsStat.cardReaderSoftwareUpdateTapped, | ||
WooAnalyticsStat.cardReaderSoftwareUpdateStarted, | ||
WooAnalyticsStat.cardReaderSoftwareUpdateSuccess, | ||
WooAnalyticsStat.cardReaderSoftwareUpdateFailed, | ||
WooAnalyticsStat.cardReaderSoftwareUpdateCancelTapped, | ||
WooAnalyticsStat.cardReaderSoftwareUpdateCanceled, | ||
|
||
// Card-Present Payments Onboarding | ||
WooAnalyticsStat.cardPresentOnboardingLearnMoreTapped, | ||
WooAnalyticsStat.cardPresentOnboardingCompleted, | ||
WooAnalyticsStat.cardPresentOnboardingNotCompleted, | ||
WooAnalyticsStat.cardPresentOnboardingStepSkipped, | ||
WooAnalyticsStat.cardPresentOnboardingCtaTapped, | ||
WooAnalyticsStat.cardPresentOnboardingCtaFailed, | ||
|
||
// Receipts | ||
// TODO: 15058-gh | ||
|
||
// Payments | ||
WooAnalyticsStat.collectPaymentCanceled, | ||
WooAnalyticsStat.collectPaymentFailed, | ||
WooAnalyticsStat.collectPaymentSuccess, | ||
WooAnalyticsStat.collectInteracPaymentSuccess, | ||
WooAnalyticsStat.interacRefundSuccess, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understand, there's no way to reproduce refund-related events, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK you're right, I'm not very acquainted with Interac but I believe that's the case and it was pretty challenging just to make them work ( some context on pdfdoF-yL-p2 and pdfdoF-R4-p2 ) |
||
WooAnalyticsStat.interacRefundFailed, | ||
WooAnalyticsStat.interacRefundCanceled, | ||
|
||
// Payment Methods | ||
WooAnalyticsStat.paymentsFlowCompleted, | ||
WooAnalyticsStat.paymentsFlowCanceled, | ||
WooAnalyticsStat.paymentsFlowFailed, | ||
WooAnalyticsStat.paymentsFlowCollect, | ||
] | ||
|
||
guard Self.isPOSModeActive, pointOfSaleEventList.contains(event) else { | ||
return eventName | ||
} | ||
return eventName | ||
let prefix = "pos_" | ||
return "\(prefix)\(eventName)" | ||
} | ||
|
||
func refreshTracksMetadata() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get support will be with
pos
andsupport_new_request_viewed
without POS. I think this is fine, since this functionality lives outside POS but I'm point it out.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! I saw the same when testing. I left it out because as you mention we're already "outside POS" and it's not in the Android or the P2 list either 👍