Skip to content

Commit 74feb97

Browse files
committed
analytics for pos filtering
1 parent de893f4 commit 74feb97

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

WooCommerce/Classes/Analytics/WooAnalyticsEvent+OrdersListFilter.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ 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
}

WooCommerce/Classes/ViewRelated/Orders/Order Filters/FilterOrderListViewModel.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,5 +405,14 @@ extension FilterOrderListViewModel {
405405
return false
406406
}
407407
}
408+
409+
var analyticsDescription: String? {
410+
switch self {
411+
case .pointOfSale:
412+
return "pos"
413+
case .any:
414+
return nil
415+
}
416+
}
408417
}
409418
}

0 commit comments

Comments
 (0)