Facebook pixel code

OMG

help me how to instal this - I guess this is the biggest downside of using X THEME— havent got a clue how to make child theme

and all my editing on my site design will be down the drain if i change to child theme – all will be zero

Hi There,

Thanks for writing in! Follow the code below and add it into your child theme’s functions.php file.

// Begin Facebook Pixel Code
function my_facebook_pixel_code(){
?>

<!-- Replace this line with Pixel Code provided by Facebook -->

<?php 
}
add_action( 'wp_head', 'my_facebook_pixel_code' );
// End Facebook Pixel Code

Hope that helps.

1 Like

Hello there

I dont know where or what is child theme

guide me pls

and so I will lose all my editing done now? my designs? OMG please advise

Hi There,

Sorry for the confusion. You need to setup a child theme to keep your customizations separately so that you won’t lose those data when you update your X theme. Please review our guide below.

https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57

Hope that helps.

1 Like

I was able to solve it myself - a plugin called

INSERT HEADERS and Footers

How come no one suggested this plugin?

But anyway its all done now-- pixel is active

Great I am glad you figured it out. :slight_smile:

OK,

I’ve searched and done everything from headers and footers to cat plugin, to manually editing functions in my child theme (with your bits top and bottom) and still getting errors.

I know is isolated to x-theme as I have working fine on other brand templates using all 3 methods tried above for other sites…

Hello There,

Thanks for updating this thread. You are having this problem because you have implemented the code incorrectly.

Where did you added the code? Please review the previous thread to fully understand where to properly insert the code.

Please let us know how it goes.

Nah that was header and footer trial which didnt work

I removed that again for the 10th time…

I tried that with your code top and bottom…

So I tried

  1. header and footer - fail… using your top and bottom (several versions in this forum)
  2. Pixel cat lite (currently on now) - only one error - will attach
  3. Functions with your header and footer code and same as pixel cat lite - 1 error

Hello There,

I have checked your site and I got this results:

I’ve traced the warning message and this is what I got:

Pixel is not paired with a product catalog

To resolve this, please check this out:
https://developers.facebook.com/docs/facebook-pixel/pixel-helper#catalog-pair

spacebook are doing updates to business console so keep getting oops whatevers - sigh. I assume this is why I am having problems the interface is changing too…

edit: not oops: “Ouch! Something went wrong…”

helpful

Hey There,

Thanks for sharing this information. Business console might be having some issues at the moment. Please check it back later.