WC_Settings_Tracking::send_settings_change_event()publicWC 1.0

Send a Tracks event for WooCommerce options that changed values.

Method of the class: WC_Settings_Tracking{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Settings_Tracking = new WC_Settings_Tracking();
$WC_Settings_Tracking->send_settings_change_event();

WC_Settings_Tracking::send_settings_change_event() code WC 7.7.0

public function send_settings_change_event() {
	global $current_tab, $current_section;

	if ( empty( $this->updated_options ) ) {
		return;
	}

	$properties = array(
		'settings' => implode( ',', $this->updated_options ),
	);

	foreach ( $this->toggled_options as $state => $options ) {
		if ( ! empty( $options ) ) {
			$properties[ $state ] = implode( ',', $options );
		}
	}

	$properties['tab']     = $current_tab ?? '';
	$properties['section'] = $current_section ?? '';

	WC_Tracks::record_event( 'settings_change', $properties );
}