Skip to content

Commit 5d3d758

Browse files
committed
Add Tracks event for shipment tracking loaded
1 parent 9becc52 commit 5d3d758

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

WooCommerce/Classes/Analytics/WooAnalyticsStat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public enum WooAnalyticsStat: String {
156156
case orderStatusChangeSuccess = "order_status_change_success"
157157
case orderStatusChangeFailed = "order_status_change_failed"
158158
case orderStatusChangeUndo = "order_status_change_undo"
159+
case orderTrackingLoaded = "order_tracking_loaded"
159160

160161
// Push Notifications Events
161162
//

WooCommerce/Classes/ViewRelated/Orders/OrderDetailsViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,16 @@ private extension OrderDetailsViewController {
536536
}
537537

538538
func syncTracking(onCompletion: ((Error?) -> Void)? = nil) {
539+
let orderID = viewModel.order.orderID
539540
let action = ShipmentAction.synchronizeShipmentTrackingData(siteID: viewModel.order.siteID,
540-
orderID: viewModel.order.orderID) { error in
541+
orderID: orderID) { error in
541542
if let error = error {
542543
DDLogError("⛔️ Error synchronizing tracking: \(error.localizedDescription)")
543544
onCompletion?(error)
544545
return
545546
}
547+
548+
WooAnalytics.shared.track(.orderTrackingLoaded, withProperties: ["id": orderID])
546549
onCompletion?(nil)
547550
}
548551

0 commit comments

Comments
 (0)