Automattic\WooCommerce\Admin\Features\Fulfillments
FulfillmentsTracker::track_fulfillment_tracking_added
Track when tracking information is successfully added to a fulfillment.
Tracked from: OrderFulfillmentsRestController (create and update flows). Measures: How merchants add tracking info (auto-lookup vs. manual vs. API) and which carriers are used. The provider_name property for custom providers is used to identify the most frequently added custom carriers, informing the roadmap for expanding native carrier support.
Method of the class: FulfillmentsTracker{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = FulfillmentsTracker::track_fulfillment_tracking_added( $fulfillment_id, $entry_method, $provider_name, $is_custom_provider ): void;
- $fulfillment_id(int) (required)
- The ID of the fulfillment to which tracking was added.
- $entry_method(string) (required)
- How the tracking was added ("ui_auto_lookup", "ui_manual_select", "ui_manual_custom", or "api").
- $provider_name(string) (required)
- The name/key of the shipping provider (e.g., "usps", "fedex").
- $is_custom_provider(true|false) (required)
- Whether the provider is a custom (non-native) provider.
Changelog
| Since 10.7.0 | Introduced. |
FulfillmentsTracker::track_fulfillment_tracking_added() FulfillmentsTracker::track fulfillment tracking added code WC 10.7.0
public static function track_fulfillment_tracking_added( int $fulfillment_id, string $entry_method, string $provider_name, bool $is_custom_provider ): void {
WC_Tracks::record_event(
'fulfillment_tracking_added',
array(
'fulfillment_id' => $fulfillment_id,
'entry_method' => $entry_method,
'provider_name' => $provider_name,
'is_custom_provider' => $is_custom_provider,
)
);
}