Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
case .pointOfSaleAsATabi1:
return true
case .pointOfSaleAsATabi2:
return buildConfig == .localDeveloper || buildConfig == .alpha
return true
case .pointOfSaleOrdersi1:
return true
case .pointOfSaleOrdersi2:
Expand Down
2 changes: 2 additions & 0 deletions WooCommerce/Classes/Analytics/WooAnalyticsStat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,8 @@ enum WooAnalyticsStat: String {
// MARK: Point of Sale events
case pointOfSaleTabSelected = "main_tab_pos_selected"
case pointOfSaleTabVisibilityChecked = "pos_tab_visibility_checked"
case pointOfSaleIneligibleUIShown = "pos_ineligible_ui_shown"
case pointOfSaleIneligibleUIRetryTapped = "pos_ineligible_ui_retry_tapped"
case pointOfSaleLoaded = "loaded"
case pointOfSaleItemsFetched = "items_fetched"
case pointOfSaleItemsPullToRefresh = "items_pull_to_refresh"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
extension WooAnalyticsEvent {
enum PointOfSaleIneligibleUI {
/// Event property key.
private enum Key {
static let reason = "reason"
}

static func ineligibleUIShown(reason: POSIneligibleReason) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .pointOfSaleIneligibleUIShown, properties: [Key.reason: reason.analyticsValue])
}

static func ineligibleUIRetryTapped(reason: POSIneligibleReason) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .pointOfSaleIneligibleUIRetryTapped, properties: [Key.reason: reason.analyticsValue])
}
}
}

private extension POSIneligibleReason {
var analyticsValue: String {
switch self {
case .unsupportedCurrency:
return "store_currency"
case .unsupportedWooCommerceVersion:
return "wc_plugin_version"
case .featureSwitchDisabled:
return "feature_switch_disabled"
case .wooCommercePluginNotFound:
return "unknown_wc_plugin"
case .unsupportedIOSVersion:
return "ios_version"
case .siteSettingsNotAvailable,
.selfDeallocated:
return "other"
}
}
}
9 changes: 9 additions & 0 deletions WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ struct POSIneligibleView: View {
Task { @MainActor in
do {
isLoading = true
ServiceLocator.analytics.track(
event: .PointOfSaleIneligibleUI.ineligibleUIRetryTapped(reason: reason)
)
try await onRefresh()
isLoading = false
} catch {
Expand Down Expand Up @@ -71,6 +74,12 @@ struct POSIneligibleView: View {
Spacer()
}
.padding(POSPadding.large)
.onAppear {
ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: reason))
}
.onChange(of: reason) { newReason in
ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: newReason))
}
}

private var suggestionText: String {
Expand Down
4 changes: 4 additions & 0 deletions WooCommerce/WooCommerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
02162727237963AF000208D2 /* ProductFormViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 02162725237963AF000208D2 /* ProductFormViewController.xib */; };
02162729237965E8000208D2 /* ProductFormTableViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02162728237965E8000208D2 /* ProductFormTableViewModel.swift */; };
0216272B2379662C000208D2 /* DefaultProductFormTableViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0216272A2379662C000208D2 /* DefaultProductFormTableViewModel.swift */; };
0216DA702E2576CB00016600 /* WooAnalyticsEvent+PointOfSaleIneligibleUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0216DA6F2E2576C300016600 /* WooAnalyticsEvent+PointOfSaleIneligibleUI.swift */; };
0218B4EC242E06F00083A847 /* MediaType+WPMediaType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0218B4EB242E06F00083A847 /* MediaType+WPMediaType.swift */; };
0219B03723964527007DCD5E /* PaginatedProductShippingClassListSelectorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0219B03623964527007DCD5E /* PaginatedProductShippingClassListSelectorDataSource.swift */; };
021A17212D7036AF006DF7C0 /* DynamicFrameScaler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021A17202D7036AF006DF7C0 /* DynamicFrameScaler.swift */; };
Expand Down Expand Up @@ -3336,6 +3337,7 @@
02162725237963AF000208D2 /* ProductFormViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProductFormViewController.xib; sourceTree = "<group>"; };
02162728237965E8000208D2 /* ProductFormTableViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFormTableViewModel.swift; sourceTree = "<group>"; };
0216272A2379662C000208D2 /* DefaultProductFormTableViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultProductFormTableViewModel.swift; sourceTree = "<group>"; };
0216DA6F2E2576C300016600 /* WooAnalyticsEvent+PointOfSaleIneligibleUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WooAnalyticsEvent+PointOfSaleIneligibleUI.swift"; sourceTree = "<group>"; };
0218B4EB242E06F00083A847 /* MediaType+WPMediaType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MediaType+WPMediaType.swift"; sourceTree = "<group>"; };
0219B03623964527007DCD5E /* PaginatedProductShippingClassListSelectorDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginatedProductShippingClassListSelectorDataSource.swift; sourceTree = "<group>"; };
021A17202D7036AF006DF7C0 /* DynamicFrameScaler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicFrameScaler.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -7717,6 +7719,7 @@
02D1D2D82CD3CD710069A93F /* Analytics */ = {
isa = PBXGroup;
children = (
0216DA6F2E2576C300016600 /* WooAnalyticsEvent+PointOfSaleIneligibleUI.swift */,
68F68A4F2D6730DF00BB9568 /* POSCollectOrderPaymentAnalyticsTracking.swift */,
68F896412D5E4321000B308B /* POSCollectOrderPaymentAnalytics.swift */,
02D1D2D92CD3CD8D0069A93F /* WooAnalyticsEvent+PointOfSale.swift */,
Expand Down Expand Up @@ -16633,6 +16636,7 @@
B59D1EE5219080B4009D1978 /* Note+Woo.swift in Sources */,
02913E9523A774C500707A0C /* UnitInputFormatter.swift in Sources */,
0204E3622B8CD40B00F1B5FD /* WooAnalyticsEvent+Products.swift in Sources */,
0216DA702E2576CB00016600 /* WooAnalyticsEvent+PointOfSaleIneligibleUI.swift in Sources */,
4508BF622660E34A00707869 /* ShippingLabelCarrierAndRatesTopBanner.swift in Sources */,
DE7E5E7F2B4BC52C002E28D2 /* MultiSelectionList.swift in Sources */,
DA0DBE2F2C4FC61D00DF14C0 /* POSFloatingControlView.swift in Sources */,
Expand Down
Loading