How to Add Facebook Pixel to your website

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.
    1. From your Shopify admin, go to Online Store > Themes.
    2. In the Current theme section, click Actions, and select Edit code.
    3. Click the theme.liquid file to open the code editor.
    4. Delete the Facebook pixel code. You can find it between the <head> and </head> tags.
    5. 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
    • Contact
    • Customize product
    • Donate
    • Find location
    • Initiate checkout
    • Lead
    • Purchase
    • Search
    • 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.

If you're interested in learning more about powerful, user-friendly GemPages, please feel free to figure out more articles in the GemPages help center or reach our Support Team. We'd be happy to answer any questions you have.


Was this helpful?