wc_admin_record_tracks_event()WC 1.0

Record an event using Tracks.

No Hooks.

Return

null. Nothing (null).

Usage

wc_admin_record_tracks_event( $event_name, $properties );
$event_name(string) (required)
Event name for tracks.
$properties(array)
Properties to pass along with event.
Default: array()

wc_admin_record_tracks_event() code WC 9.4.2

function wc_admin_record_tracks_event( $event_name, $properties = array() ) {
	// WC post types must be registered first for WC_Tracks to work.
	if ( ! post_type_exists( 'product' ) ) {
		return;
	}

	if ( ! class_exists( 'WC_Tracks' ) ) {
		if ( ! defined( 'WC_ABSPATH' ) || ! file_exists( WC_ABSPATH . 'includes/tracks/class-wc-tracks.php' ) ) {
			return;
		}

		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-client.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-footer-pixel.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-site-tracking.php';
	}

	WC_Tracks::record_event( $event_name, $properties );
}