WooCommerce Code Reference

Search results

WC_Tracks

WC_Tracks class.

Table of Contents

PREFIX Tracks event name prefix. 'wcadmin_'
get_products_count() Get total product counts. int
get_blog_details() Gather blog related properties. array
get_server_details() Gather details from the request to the server. array
record_event() Record an event in Tracks - this is the preferred way to record events from PHP. bool|WP_Error

Constants

Methods

get_products_count()

Get total product counts.

public static get_products_count( ) : int
Return values
int

Number of products.

get_blog_details()

Gather blog related properties.

public static get_blog_details( $user_id : int ) : array
Parameters
$user_id : int

User id.

Return values
array

Blog details.

get_server_details()

Gather details from the request to the server.

public static get_server_details( ) : array
Return values
array

Server details.

record_event()

Record an event in Tracks - this is the preferred way to record events from PHP.

public static record_event( $event_name : string [, $properties : array = array() ] ) : bool|WP_Error
Parameters
$event_name : string

The name of the event.

$properties : array = array()

Custom properties to send with the event.

Return values
bool|WP_Error

True for success or WP_Error if the event pixel could not be fired.

Back to the top