WC_Tracks::get_properties()public staticWC 1.0

Get all properties for the event including filtered and identity properties.

Method of the class: WC_Tracks{}

Hooks from the method

Return

Array.

Usage

$result = WC_Tracks::get_properties( $event_name, $event_properties );
$event_name(string) (required)
Event name.
$event_properties(array) (required)
Event specific properties.

WC_Tracks::get_properties() code WC 8.9.0

public static function get_properties( $event_name, $event_properties ) {
	/**
	 * Allow event props to be filtered to enable adding site-wide props.
	 *
	 * @since 4.1.0
	 */
	$properties = apply_filters( 'woocommerce_tracks_event_properties', $event_properties, $event_name );
	$user       = wp_get_current_user();
	$identity   = WC_Tracks_Client::get_identity( $user->ID );

	// Delete _ui and _ut protected properties.
	unset( $properties['_ui'] );
	unset( $properties['_ut'] );

	$data = $event_name
		? array(
			'_en' => $event_name,
			'_ts' => WC_Tracks_Client::build_timestamp(),
		)
		: array();

	$server_details = self::get_server_details();
	$blog_details   = self::get_blog_details( $user->ID );

	return array_merge( $properties, $data, $server_details, $identity, $blog_details );
}