WC_Tracks_Footer_Pixel::render_tracking_pixels()publicWC 1.0

Add events as tracking pixels to page footer.

Method of the class: WC_Tracks_Footer_Pixel{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Tracks_Footer_Pixel = new WC_Tracks_Footer_Pixel();
$WC_Tracks_Footer_Pixel->render_tracking_pixels();

WC_Tracks_Footer_Pixel::render_tracking_pixels() code WC 7.7.0

public function render_tracking_pixels() {
	if ( empty( $this->events ) ) {
		return;
	}

	foreach ( $this->events as $event ) {
		$pixel = $event->build_pixel_url();

		if ( ! $pixel ) {
			continue;
		}

		echo '<img style="position: fixed;" src="', esc_url( $pixel ), '" />';
	}

	$this->events = array();
}