WC_Tracks_Footer_Pixel::record_event()public staticWC 1.0

Record a Tracks event

Method of the class: WC_Tracks_Footer_Pixel{}

No Hooks.

Return

true|false|WP_Error. True on success, WP_Error on failure.

Usage

$result = WC_Tracks_Footer_Pixel::record_event( $event );
$event(array) (required)
Array of event properties.

WC_Tracks_Footer_Pixel::record_event() code WC 8.9.0

public static function record_event( $event ) {
	if ( ! $event instanceof WC_Tracks_Event ) {
		$event = new WC_Tracks_Event( $event );
	}

	if ( is_wp_error( $event ) ) {
		return $event;
	}

	self::instance()->add_event( $event );

	return true;
}