WC_Tracks_Footer_Pixel::render_tracking_pixels
Add events as tracking pixels to page footer.
Method of the class: WC_Tracks_Footer_Pixel{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Tracks_Footer_Pixel = new WC_Tracks_Footer_Pixel(); $WC_Tracks_Footer_Pixel->render_tracking_pixels();
WC_Tracks_Footer_Pixel::render_tracking_pixels() WC Tracks Footer Pixel::render tracking pixels code WC 10.6.2
public function render_tracking_pixels() {
if ( empty( $this->events ) ) {
return;
}
foreach ( $this->events as $event ) {
$pixel = $event->build_pixel_url();
if ( ! $pixel ) {
continue;
}
// Add the Request Timestamp and no cache parameter just before the HTTP request.
$pixel = WC_Tracks_Client::add_request_timestamp_and_nocache( $pixel );
echo '<img style="position: fixed;" src="', esc_url( $pixel ), '" />';
}
$this->events = array();
}