WordPress at Your Fingertips
function is not described

WC_Tracks_Client::record_event() public WC 1.0

Record a Tracks event

{} It's a method of the class: WC_Tracks_Client{}

No Hooks.

Return

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

Usage

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

Code of WC_Tracks_Client::record_event() WC 5.8.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;
	}

	$pixel = $event->build_pixel_url( $event );

	if ( ! $pixel ) {
		return new WP_Error( 'invalid_pixel', 'cannot generate tracks pixel for given input', 400 );
	}

	return self::record_pixel( $pixel );
}