WooCommerce Code Reference

WC_Tracks
in package

WC_Tracks class.

Table of Contents

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

Constants

Methods

get_blog_details()

Gather blog related properties.

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

User id.

Return values
arrayBlog details.

get_server_details()

Gather details from the request to the server.

public static get_server_details() : array
Return values
arrayServer details.

record_event()

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

public static record_event(string $event_name[, array $properties = 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_ErrorTrue for success or WP_Error if the event pixel could not be fired.