Hey you all, we are using X-Pro and wanted to add Facebook Pixel to our header.
I noticed from another older post that you had someone add the below code to their functions.php file - unfortunately that code just added the Pixel in twice. Can I just use the first part of the script that places it into wp_head and leave off the second half. That seems to work but I wasn’t sure why you had the two parts.
/*Pixel base Code*/
function fb_print_pixel_base() { ?>
<!-- PLACE YOUR BASE PIXEL CODE HERE -->
<?php }
add_action( 'wp_head', 'fb_print_pixel_base', 999 );
/*Pixel Event Code*/
function fb_print_pixel_event() { ?>
<!-- PLACE YOUR EVENT PIXEL CODE HERE -->
<?php }
add_action( 'x_before_site_begin', 'fb_print_pixel_event' );