The Ultimate Guide to Installing Facebook Pixel on Your Shopify Store

With Facebook Pixel you can track your store performance and optimize your future advertising campaigns.
By installing the Facebook Pixel on your Shopify website, you can gain valuable insights into customer behavior, create more effective ad targeting, and ultimately boost your sales.
In this comprehensive guide, we’ll walk you through the process step-by-step, from setting up the Pixel in your Facebook Ads Manager to adding it to your Shopify store:
- What is Facebook Pixel
- How to setup Facebook Pixel on Shopify
- What Facebook Pixel tracks on Shopify
- Where to add Facebook Pixel code in Shopify
- How to remove Facebook Pixel from Shopify
- How to check if Facebook Pixel is working on Shopify
- Conclusion
What is Facebook Pixel
Facebook Pixel is a piece of code that can be placed on a website to track visitor actions and send data back to Facebook.
Gathered data can be used to track conversions from Facebook ads, optimize ad targeting, build audiences for future ads. It allows businesses to measure the effectiveness of their advertising by understanding the actions people take on their website.

How to setup Facebook Pixel on Shopify
Setting up the Facebook Pixel is a straightforward process:
- Go to your Facebook Ads Manager and navigate to the Pixels tab.
- Click on the
Create a Pixel
button. - Enter a name for your Pixel profile and click on the Create button.
- Copy the Pixel code that is generated.
- Log in to your Shopify store and navigate to the Online Store section of your admin dashboard.
- Click on Preferences.
- Scroll down to the Facebook Pixel section and paste the Pixel code into the appropriate field.
- Click on Save to apply the changes.
Once the Pixel is installed on your Shopify store, you can start tracking events and optimizing your ads.
You can also use the Facebook Pixel Helper Chrome Extension to verify that the Pixel is installed correctly and troubleshoot any issues.
Link to Chrome Extension.
What Facebook Pixel tracks on Shopify
The Facebook Pixel installed on a Shopify store can track a variety of events:
- Page views
- Adds to cart
- Initiate checkout process
- Purchases
- Content views
- Searches
- Add to wishlists
- Contacts
These events can be used to optimize your Facebook ads and target specific audiences.
Additionally, you can also create custom conversion events, such as tracking when a customer subscribes to a newsletter or signs up for a free trial.
Where to add Facebook Pixel code in Shopify
The Facebook Pixel code can be added in the theme.liquid
file, which is the main template file for your Shopify store’s theme:
- Log in to your Shopify store and navigate to the Online Store section of your admin dashboard.
- Click on Themes.
- Click on the Actions button next to the theme you want to edit, and select Edit code.
- In the left sidebar, navigate to the
Layout
folder and look for thetheme.liquid
file. - Scroll to the bottom of the file and paste the Facebook Pixel code immediately before the closing
</head>
tag. - Click on Save to apply the changes.
Once you’ve added the Facebook Pixel code to your theme file, it will be visible on every page of your website, allowing you to track events and conversions across your entire site.
Alternatively, you can also install an app from the Shopify app store that will help you to add the Facebook Pixel code easily to your Shopify store. This will save you the manual work of adding the code.
How to remove Facebook Pixel from Shopify
To remove the Facebook Pixel from your Shopify store, you can simply remove the code from your theme.liquid
file:
- Log in to your Shopify store and navigate to the Online Store section of your admin dashboard.
- Click on Themes.
- Click on the Actions button next to the theme you want to edit, and select Edit code.
- In the left sidebar, navigate to the
Layout
folder and look for thetheme.liquid
file. - Scroll to the bottom of the file and locate the Facebook Pixel code that you added earlier.
- Delete the Facebook Pixel code.
- Click on Save to apply the changes.
Alternatively, if you had installed an app to add the pixel, you can simply uninstall the app and it will remove the Pixel code automatically.
You verify that the Pixel has been removed from your website by using the Facebook Pixel Helper Chrome Extension. Link to Chrome extension was mentioned few sections above.
How to check if Facebook Pixel is working on Shopify
There are several ways to check if the Facebook Pixel is working on your Shopify store:
- Use the Facebook Pixel Helper Chrome Extension: This is a free tool that allows you to check if the Pixel is installed correctly on your website and troubleshoot any issues. Once you’ve installed the extension, simply navigate to your website and click on the extension icon in your browser’s toolbar to see if the Pixel is working correctly.
- Check the Pixel’s Activity: Go to your Facebook Ads Manager and navigate to the Pixels tab. Here you can check if your pixel is working by looking at the recent activity,. If you see any activity it means that the pixel is working and collecting data.
- You can use Facebook’s Pixel Test to send test events to your Pixel and ensure that it’s working correctly. To use this tool, navigate to the Pixels tab in your Facebook Ads Manager, and click on the
Test Events
button. - Verify the custom events: If you have set up custom events, you can verify if they are working by navigating to the events manager in your Facebook Ads Manager. Custom events will be listed in the events manager if they have been set up correctly and have fired at least one time.
Conclusion
Implementing the Facebook Pixel on a Shopify store can greatly benefit the store owner by providing valuable insights into the store’s customer behavior, allowing for better targeting and optimization of Facebook ads.
With Shopify’s simple integration process, setting up the Facebook Pixel can be done easily and quickly, giving store owners access to the full range of Facebook’s advertising tools and the ability to drive more sales and conversions in the future.
Read more Shopify marketing articles on our blog.