To create a Facebook pixel for your Shopify store, you make the pixel in Meta Events Manager, then connect it to your store through Shopify's Facebook & Instagram app. Once it is connected, the pixel records what visitors do on your store and sends it to Meta, so you can measure your ads, retarget visitors and build audiences.
This guide covers creating the pixel, linking it to your ad account, connecting it to Shopify, testing it, and putting the data to use. If your pixel already exists and you only need to install it, see how to set up a Facebook pixel on Shopify.
Key takeaways
- The Facebook pixel (now the Meta pixel) records what visitors do on your store and sends it to Meta.
- Create the pixel in Meta Events Manager, under Connect data sources, then Web.
- Connect it to Shopify through the Facebook & Instagram app, not by pasting code into your theme.
- Choose Enhanced or Maximum data sharing so events also go through Meta's Conversions API.
- Test with Meta Pixel Helper and Test Events, then use the data for conversions, custom audiences and lookalikes.
![]()
What a Facebook Pixel Is
A Facebook pixel is a small piece of code that records what visitors do on your website and sends those events to Meta. Meta now calls it the Meta pixel; it covers Facebook and Instagram ads.
Once it is on your store, it records events such as page views, product views, add-to-cart, checkout started and purchases.
Say someone views a pair of shoes and leaves without buying. With the pixel, you can show them an ad for those shoes later, perhaps with a discount. The same data tells Meta which of your ads led to sales, so it can show your ads to people more likely to buy.
Setting up Your Facebook Pixel
Before you create the pixel, check you have these in place.
- A Meta business portfolio. This is the business account in Meta Business Suite where you manage pixels, ad accounts and pages. It is free to create.
- An ad account in that portfolio, if you plan to run ads.
- Admin access to your Shopify store, with permission to install apps.
- A list of what you want to track. For most stores, that is product views, add-to-cart, checkout started and purchases, and possibly sign-ups.
Use your business email when you sign up, so access stays with the business rather than one person.
Also update your privacy policy. A pixel collects data about visitors, so your policy should say so. Depending on where your customers are, laws such as GDPR or CCPA may also require a cookie consent banner. Shopify's customer privacy settings can handle consent for you.
Creating a New Pixel in Facebook
You create the pixel in Meta Events Manager.
- Open Meta Events Manager.
- Click Connect data sources and choose Web.
- Choose Meta Pixel and give it a clear name, such as "Shopify_Main". If you run several stores, put the store name in it.
- Enter your website address if asked.
- When Meta offers installation options, choose the partner integration for Shopify, or simply stop here and connect it from Shopify in the next steps.
Meta gives the pixel a pixel ID, a long number. You do not need to paste it anywhere for Shopify, but note it down, because you will use it to check you picked the right pixel later.
Do not also add the pixel code to your theme by hand. Shopify's app adds it for you, and adding it twice sends duplicate events and inflates your results.
Adding Pixel to Facebook Ad Account
Link the pixel to the ad account you advertise from, so your campaigns can use its data.
- Open Business Settings in Meta Business Suite.
- Go to Data sources, and find your pixel. Meta may list it under datasets.
- Choose Connect assets or Add assets and select your ad account.
- If people on your team or an agency run your ads, give them access to the pixel here too.
If you have more than one pixel, check you linked the right one. Ads optimized against the wrong pixel will report the wrong results.
Once linked, your campaigns can optimize for pixel events such as purchases, and you can build custom audiences and lookalike audiences from the visitors it records.
Integrating Pixel with Shopify
Shopify connects the pixel through the Facebook & Instagram app, sometimes listed as Facebook & Instagram by Meta.
- In your Shopify admin, install the Facebook & Instagram app from the Shopify App Store.
- Connect your Facebook account and your Meta business portfolio.
- In the app's settings, turn on customer data sharing.
- Choose a data sharing level:
- Standard: the pixel only, in the visitor's browser. Ad blockers can stop it.
- Enhanced: the pixel plus Meta's Conversions API, which sends events from Shopify's servers, along with customer details that help Meta match visitors to its users.
- Maximum: the same as Enhanced, with Meta's latest ad technology turned on.
- Select the pixel you created and save.
Enhanced or Maximum is the better choice for most stores, because the Conversions API still sends purchases when a browser blocks the pixel. Shopify's help pages explain exactly what each level shares. Because the app runs inside Shopify, it also covers checkout events, which code pasted into a theme cannot reach.
The app connects one Meta pixel. If you need more than one, for example for two ad accounts, use an app that supports several pixels, such as MultiPixels.
Testing Your Pixel
Check that events arrive before you spend money on ads.
- Install Meta Pixel Helper, a Chrome extension, and browse your store. It shows each event the pixel sends on each page.
- In Events Manager, open your pixel and use Test Events. Browse your store in another tab and watch the events appear.
- Place a test order to check that the purchase event arrives with the right value.
If events are missing, check that data sharing is on in the Facebook & Instagram app, that the right pixel is selected, and that no other app or theme code is sending the same pixel.
Making the Most of Your Facebook Pixel
A working pixel gives you four things: conversion tracking, custom audiences, lookalike audiences and event data.
Optimize Ad Campaigns with Conversion Tracking The pixel shows what people do after clicking your ads: product views, add-to-carts and purchases. Purchase events carry the order value, so you can see return on ad spend for each campaign. If many people add to cart but few buy, look at the checkout: shipping costs, delivery times and payment options.
Create Custom Audiences for Retargeting The pixel lets you build custom audiences from your visitors and show them Facebook ads. For example, you can retarget people who viewed a product but did not buy, and show them that product again. You can also target broader groups, such as everyone who visited in the last 30 days.
Explore Lookalike Audiences A lookalike audience finds new people who resemble an audience you already have, such as your buyers. Meta looks for shared patterns and shows your ads to similar users. The larger and more specific the source audience, the better: buyers usually make a better source than all visitors.
Use Event Tracking for Deeper Insights Beyond the standard ecommerce events, you can track custom events such as clicks on a button or use of your search bar. These show which parts of your store help people buy.
Using Pixel for Targeted Ads
Pixel events let you target people by what they did on your store, not just who they are.
Micro-conversions. Small actions show interest before a purchase: viewing a category, clicking a promotion, or viewing several products. You can show people who viewed several items but added nothing to their cart a collection of best sellers.
Event-based audiences. Target people who started checkout but did not finish, with ads that answer common doubts, such as your returns policy or customer reviews.
Seasonal patterns. Look at past pixel data around holidays and sales to see when people browse and when they buy, and plan your ad budget around those weeks.
Quick adjustments. Watch results as a campaign runs. If an ad brings plenty of visits but few purchases, change the creative, the offer or the landing page.
Tracking Pixel Data for Success
Review your pixel data regularly and act on it.
In Events Manager, check that each event is arriving and look at its event match quality, which shows how well Meta can match your events to its users. In Ads Manager, compare campaigns by purchases and return on ad spend.
High traffic with low sales usually means the ad and the landing page do not match, or the product page needs work. Campaigns that sell well show you which audiences and messages to use again.
Expect Meta's numbers to differ a little from Shopify's. They count visits and attribute sales in different ways, and ad blockers and consent choices mean the pixel misses some visitors.
If you advertise on more than Meta, MultiPixels installs Meta, TikTok, Pinterest, Snapchat and GA4 pixels on a Shopify store without editing theme code. Install MultiPixels on your Shopify store to run several tracking pixels at once.
FAQs
Why do people keep telling me to add a Facebook Pixel to my Shopify store?
Because without it, Meta cannot see what happens on your store after someone clicks an ad. The pixel records views, add-to-carts and purchases, so you can measure your ads, retarget visitors and let Meta show your ads to people more likely to buy.
Do I need to know how to code to add a Pixel to my store?
No. Create the pixel in Meta Events Manager, then install Shopify's Facebook & Instagram app, turn on customer data sharing and select your pixel. Shopify adds the pixel to your store for you.
Is there still a Facebook Pixel ID field in Shopify's Preferences?
No. Shopify removed that field. The pixel is now connected through the Facebook & Instagram app's data sharing settings.
Does the Pixel track things like add-to-cart actions and purchases, not just page views?
Yes. Through the Facebook & Instagram app, the pixel records page views, product views, add-to-cart, checkout started and purchases, with order values.
Can I run more than one Facebook Pixel on the same Shopify store?
Shopify's Facebook & Instagram app connects one Meta pixel. To run more than one, use an app built for several pixels, such as MultiPixels.
The Pixel isn’t firing on my Shopify store, where do I start troubleshooting?
Use Meta Pixel Helper and Test Events in Events Manager. Check that customer data sharing is turned on in the Facebook & Instagram app, that the right pixel is selected, and that no theme code or other app sends the same pixel twice.