WooCommerce Code Reference

in package

WC_Tracks_Footer_Pixel class.

Table of Contents

$events  : array<string|int, mixed>
Events to send to Tracks.
$instance  : WC_Tracks_Footer_Pixel
Singleton instance.
__construct()  : mixed
Constructor - attach hooks to the singleton instance.
add_event()  : mixed
Add a Tracks event to the queue.
clear_events()  : mixed
Clear all queued events.
get_events()  : mixed
Get all events.
instance()  : WC_Tracks_Footer_Pixel
Instantiate the singleton.
record_event()  : bool|WP_Error
Record a Tracks event
render_tracking_pixels()  : mixed
Add events as tracking pixels to page footer.
send_tracks_requests()  : mixed
Fire off API calls for events that weren't converted to pixels.




Record a Tracks event

public static record_event(array<string|int, mixed> $event) : bool|WP_Error
$event : array<string|int, mixed>

Array of event properties.

Return values
bool|WP_ErrorTrue on success, WP_Error on failure.