The Facebook Pixel code needs to be added just before the closing head tag. The easiest way to do this is by using the Insert Headers and Footers plugin. After installing and activating the plugin, you need to go to the Settings > Insert Headers and Footers page.
You can paste your Facebook Pixel code in the header section and click on the save button to store your changes.
That’s all, you have successfully installed Facebook Pixel on your WordPress website.