In this article, you will learn how to add Facebook pixels to your store.
Facebook pixel is an analytics tool that helps you to measure the effectiveness of your advertising by understanding your customer behavior and traffic on your online store.
Create a Facebook Ads account
It requires a Facebook ads account to be able to create a Facebook Pixel. You can sign up for an account here.
Create a Facebook Pixel and get the Facebook Pixel ID
- Step 1: If you have created the Pixel already, you can skip this step. Otherwise, please follow the instruction from Facebook here to set it up.
To collect data properly, you may consider removing the code if you've added the Facebook pixel to your online store by editing your store's theme in Shopify. Removing the code won't affect your data on Facebook as long as you add pixel ID soon after removing code. Here is the instruction to get rid of the old code.
- From your Shopify admin, go to Online Store > Themes.
- In the Current theme section, click Actions, and select Edit code.
- Click the theme.liquid file to open the code editor.
- Delete the Facebook pixel code. You can find it between the <head> and </head> tags.
- Click Save.
- Step 2: Copy the Pixel ID under the Settings tab of the Event Manager page.
You can use one pixel across your whole website, including multiple pages of your website.
Add a Facebook Pixel ID to your Shopify store
- Step 1: From your Shopify admin, go to Online Store -> Preferences.
- Step 2: Scroll down and locate the Facebook Pixel item. Then insert Facebook Pixel ID in the box.
- Step 3: Hit the Save button at the bottom of the page. It will integrate the pixel with your online store (usually in a few seconds) without requiring any codes. Once all is set, you can collect data for standard events including:
- Add payment info
- Add to cart
- Add to wishlist
- Complete registration
- Customize product
- Find location
- Initiate checkout
- Start trial
- Submit application
- View content
For further information about actions associated with each event, we invite you to learn more from the Facebook help center here.