Place code in the header of landing page

We have been provided a pixel (script) by a company called Gloo doing facebook marketing for our client. We created a landing page for this purpose on our website using integrity theme built with cornerstone:

They have requested we “place the following code in the header of the landing page”

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '144916392901508'); // Insert your pixel ID here.
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=144916392901508&ev=PageView&noscript=1"
/></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->

I am unsure how to perform this. I did read a forum thread that gave me a lot of information and we have a child .php file but the thread was not really specific to my need and was from 2016 so I hope I am hoping for instruction to install this code on the page specified since I am only a novice, James.

Hi there,

Please add this code in the functions.php of the child theme:

function my_custom_head_output() { 
  if (is_page( 12848 )): ?>
          <!-- Facebook Pixel Code -->
         
          <!-- End Facebook Pixel Code -->
 <?php endif; } 

add_action( 'wp_head', 'my_custom_head_output', 99 ); ?>

Please place the code in the area that says:

      <!-- Facebook Pixel Code -->
     
      <!-- End Facebook Pixel Code -->

Also, the page ID of the landing page you have linked it 12848 which is specified in the code above.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.