Skip to content

Commit 954ea45

Browse files
authored
[POS Orders] Add analytics for point of sale order filtering (#15890)
2 parents 34c8ee4 + 26e679b commit 954ea45

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

WooCommerce/Classes/Analytics/WooAnalyticsEvent+OrdersListFilter.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,29 @@ extension WooAnalyticsEvent {
88
static let dateRange = "date_range"
99
static let product = "product"
1010
static let customer = "customer"
11+
static let salesChannel = "sales_channel"
1112
}
1213

1314
/// Tracked upon filtering orders
1415
static func onFilterOrders(filters: FilterOrderListViewModel.Filters) -> WooAnalyticsEvent {
1516
let properties: [String: WooAnalyticsEventPropertyType?] = [Key.status: filters.orderStatus?.analyticsDescription,
1617
Key.dateRange: filters.dateRange?.analyticsDescription,
1718
Key.product: filters.product?.analyticsDescription,
18-
Key.customer: filters.customer?.analyticsDescription]
19+
Key.customer: filters.customer?.analyticsDescription,
20+
Key.salesChannel: filters.salesChannel?.analyticsDescription]
1921
return WooAnalyticsEvent(statName: .ordersListFilter,
2022
properties: properties.compactMapValues { $0 })
2123
}
2224
}
2325
}
26+
27+
fileprivate extension FilterOrderListViewModel.SalesChannelFilter {
28+
var analyticsDescription: String? {
29+
switch self {
30+
case .pointOfSale:
31+
return "pos"
32+
case .any:
33+
return nil
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)