WC_Tracks::track_woocommerce_allow_tracking_toggled()
Track when the user attempts to toggle woocommerce_allow_tracking option.
Method of the class: WC_Tracks{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$result = WC_Tracks::track_woocommerce_allow_tracking_toggled( $prev_value, $new_value, $context );
- $prev_value(string) (required)
- The previous value for the setting. 'yes' or 'no'.
- $new_value(string) (required)
- The new value for the setting. 'yes' or 'no'.
- $context(string)
- Which avenue the user utilized to toggle.
Default: 'settings'
Changelog
Since . | Introduced. |
WC_Tracks::track_woocommerce_allow_tracking_toggled() WC Tracks::track woocommerce allow tracking toggled code WC 9.8.5
public static function track_woocommerce_allow_tracking_toggled( $prev_value, $new_value, $context = 'settings' ) { if ( $new_value !== $prev_value ) { self::record_event( 'woocommerce_allow_tracking_toggled', array( 'previous_value' => $prev_value, 'new_value' => $new_value, 'context' => $context, ) ); } }