Skip to content

Commit bcb8d16

Browse files
committed
Add tracks for customer search
1 parent 7f42204 commit bcb8d16

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

WooCommerce/Classes/Analytics/WooAnalyticsStat.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ public enum WooAnalyticsStat: String {
245245
case orderCreateButtonTapped = "order_create_button_tapped"
246246
case orderCreationSuccess = "order_creation_success"
247247
case orderCreationFailed = "order_creation_failed"
248+
case orderCreationCustomerAdded = "order_creation_customer_added"
249+
case orderCreationCustomerSearch = "order_creation_customer_search"
248250
case orderContactAction = "order_contact_action"
249251
case orderCustomerAdd = "order_customer_add"
250252
case orderEditButtonTapped = "order_edit_button_tapped"

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/EditOrderAddressForm.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct EditOrderAddressForm<ViewModel: AddressFormViewModelProtocol>: View {
154154
if isSearchCustomersEnabled {
155155
Button(action: {
156156
showingCustomerSearch = true
157+
ServiceLocator.analytics.track(.orderCreationCustomerSearch)
157158
}, label: {
158159
Image(systemName: "magnifyingglass")
159160
})
@@ -173,6 +174,7 @@ struct EditOrderAddressForm<ViewModel: AddressFormViewModelProtocol>: View {
173174
.sheet(isPresented: $showingCustomerSearch, content: {
174175
OrderCustomerListView(siteID: viewModel.siteID, onCustomerTapped: { customer in
175176
// Not implemented yet.
177+
ServiceLocator.analytics.track(.orderCreationCustomerAdded)
176178
print("3 - Customer Callback. Fill Order data with Customer details")
177179
print("4 - Customer ID: \(customer.customerID) - Name: \(customer.firstName ?? ""))")
178180
})

0 commit comments

Comments
 (0)