You can add a Facebook pixel to your Shopify store by going to “Online store” and then clicking the “Preferences” button.
On the preferences page, add your Facebook Pixel’s ID. Shopify will take care of sending the right events for you.