Complete coding illiterate here so forgive my incompetence.

Trying to install Facebook Pixel in my store, would simply copy & pasting my pixel code into here work?

enter image description here

Any help and advice are greatly appreciated.

2 Answers 2


I believe that by pasting the Pixel code Facebook gives you from the <!-- Facebook Pixel Code --> to the <!-- End Facebook Pixel Code --> would paste the relevant code before the header, and providing you follow the rest of the documentation here you should be fine. Best of luck. I should note that use the code that Facebook gives you, not the below code I've left this in for other developers to read.

<!-- Facebook Pixel Code -->
// Insert Your Facebook Pixel ID below. 
fbq('init', 'FB_PIXEL_ID');
fbq('track', 'PageView');
<!-- Insert Your Facebook Pixel ID below. --> 
<noscript><img height="1" width="1" style="display:none"
<!-- End Facebook Pixel Code -->

The easiest method is to use a free extension for Magento 2 (officially provided by Facebook)

There are also other methods like manually inserting code or using google tag manager to insert pixel code, read this tutorial for full guide: https://magentip.com/add-facebook-pixel-magento-2/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.