WordPress at Your Fingertips
function is not described

WC_REST_Telemetry_Controller::record_usage_data() public WC 1.0

Record WCTracker Data

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

No Hooks.

Return

null. Nothing.

Usage

$WC_REST_Telemetry_Controller = new WC_REST_Telemetry_Controller();
$WC_REST_Telemetry_Controller->record_usage_data( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of WC_REST_Telemetry_Controller::record_usage_data() WC 5.9.0

public function record_usage_data( $request ) {
	$new = $this->get_usage_data( $request );
	if ( ! $new || ! $new['platform'] ) {
		return;
	}

	$data = get_option( 'woocommerce_mobile_app_usage' );
	if ( ! $data ) {
		$data = array();
	}

	$platform = $new['platform'];
	if ( ! $data[ $platform ] || version_compare( $new['version'], $data[ $platform ]['version'], '>=' ) ) {
		$data[ $platform ] = $new;
	}

	update_option( 'woocommerce_mobile_app_usage', $data );
}