WC_Tracks_Footer_Pixel
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.
Properties
$events
Events to send to Tracks.
protected
array<string|int, mixed>
$events
= array()
$instance
Singleton instance.
protected
static WC_Tracks_Footer_Pixel
$instance
=
ull
Methods
__construct()
Constructor - attach hooks to the singleton instance.
public
__construct() : mixed
Return values
mixed —add_event()
Add a Tracks event to the queue.
public
add_event(WC_Tracks_Event $event) : mixed
Parameters
- $event : WC_Tracks_Event
-
Event to track.
Return values
mixed —clear_events()
Clear all queued events.
public
static clear_events() : mixed
Return values
mixed —get_events()
Get all events.
public
static get_events() : mixed
Return values
mixed —instance()
Instantiate the singleton.
public
static instance() : WC_Tracks_Footer_Pixel
Return values
WC_Tracks_Footer_Pixel —record_event()
Record a Tracks event
public
static record_event(array<string|int, mixed> $event) : bool|WP_Error
Parameters
- $event : array<string|int, mixed>
-
Array of event properties.
Return values
bool|WP_Error — True on success, WP_Error on failure.render_tracking_pixels()
Add events as tracking pixels to page footer.
public
render_tracking_pixels() : mixed
Return values
mixed —send_tracks_requests()
Fire off API calls for events that weren't converted to pixels.
public
send_tracks_requests() : mixed
This handles wp_redirect().