The short answer
- Install the Meta pixel on Shopify through the Facebook & Instagram sales channel: Settings, then Data sharing settings, then turn on customer data sharing and connect a pixel. Do not paste pixel code into the theme.
- Shopify offers three data sharing levels: Standard (pixel only), Enhanced (pixel plus Conversions API) and Maximum (both, plus Meta's latest ad technology).
- Enhanced or Maximum sends the purchase event server to server, so ad blockers cannot drop it. Standard loses purchases whenever the browser pixel is blocked.
- The pixel tracks seven events automatically: PageView, ViewContent, Search, AddToCart, InitiateCheckout, AddPaymentInfo and Purchase.
Every Meta campaign for a Shopify store optimizes on what the pixel and Conversions API report. If purchases go missing or count twice, Meta bids on the wrong people and reports the wrong ROAS. This guide covers the install, what each data sharing level sends, how to test it, and the breakages that show up most on Shopify.
How to install the Meta pixel on Shopify
The Facebook & Instagram channel, built by Meta, installs the pixel and the Conversions API together. Per Shopify's help center:
- Remove any old pixel code. Delete Meta pixel code from theme.liquid (between the head tags) and clear the Meta pixel field under Online Store, then Preferences, so only one pixel remains.
- Open the data sharing settings. In your Shopify admin, go to Sales channels, then Facebook & Instagram, then Settings, then Data sharing settings.
- Turn on customer data sharing. Switch on customer data sharing. Without it, no pixel can be connected.
- Choose Enhanced or Maximum. Pick the data sharing level. Enhanced and Maximum add the Conversions API, which sends purchases server to server.
- Connect or create the pixel. Click Connect on the pixel your ad account uses, or Create new if you have none, then confirm.
- Test with a real session. Browse, add to cart and buy on the store, then confirm each event arrives in Meta Events Manager from the browser and the server.
The channel has to be set up first; see Shopify Facebook ads for the business portfolio, Page and catalog steps. After connecting, data can take a while to appear in Meta, because events only flow once real visitors arrive.
The three data sharing levels compared
| Level | What runs | Customer data sent | Blocked by ad blockers? | Use it when |
|---|---|---|---|---|
| Standard | Meta pixel in the browser | Browsing behaviour only | Yes | You have a policy reason not to share customer details |
| Enhanced | Meta pixel plus Conversions API | Name, location, email and phone, plus browsing behaviour | Not for the server-sent purchase event | Default choice for stores running Meta ads |
| Maximum | Pixel, Conversions API and Meta's latest ad technology | Same as Enhanced | Not for the server-sent purchase event | You want new Meta features as they ship |
Shopify notes the exact privacy settings of each level depend on when you installed the channel, and that sharing customer details is your choice to disclose. Update your privacy policy to say what is shared with Meta before you switch from Standard.
The events Shopify sends
| Event | Fires when | Used for |
|---|---|---|
| PageView | Any page loads | Website audiences, reach |
| ViewContent | A product page is viewed | Catalog retargeting, product match |
| Search | A shopper searches the store | Intent audiences |
| AddToCart | A product is added to cart | Retargeting, early optimization |
| InitiateCheckout | The checkout button is clicked | Abandoned checkout audiences |
| AddPaymentInfo | Payment details are entered | Late-funnel audiences |
| Purchase | The order completes and the thank you page loads | Conversion optimization, ROAS |
Purchase value is the order total, which Shopify defines as the sum of item prices including duties, taxes and discounts. So Meta's purchase value will not match a net sales figure in Shopify reports exactly.
How to test that the pixel and Conversions API work
Do this before launching ads, and again after any theme, checkout or app change.
- Open Events Manager in Meta Business Suite and select the dataset (pixel) the channel connected.
- Use Test events. Enter your store URL, then browse a product, add it to cart and start checkout in that window. Each event should appear within seconds.
- Place a real order, small and refundable, or a test order through your payment provider. Confirm Purchase arrives with a value and currency.
- Check the source split. In the dataset overview, Purchase should show as received from both browser and server on Enhanced or Maximum.
- Check deduplication. Browser and server copies of the same purchase should be merged, not counted twice. Meta reports deduplication per event.
- Check Event Match Quality for Purchase. Low scores mean Meta cannot match many purchases to people; Enhanced or Maximum raises it by sending email and phone.
If Test events stays empty, see test events not working.
Common breakages on Shopify, and the fix
| Symptom | Usual cause on Shopify | Fix |
|---|---|---|
| Purchases counted twice | Old pixel code in theme.liquid, a pixel in Online Store Preferences, or a second app pixel, alongside the channel | Remove every pixel except the channel connection |
| Purchases missing, other events fine | Data sharing on Standard and shoppers blocking the browser pixel | Move to Enhanced or Maximum |
| No events at all | Customer data sharing switched off, or the pixel disconnected after a staff member changed it | Reconnect in Data sharing settings |
| Events land on the wrong pixel | The ad account optimizes on a different pixel than the store sends to | Point the ad set at the connected pixel, or connect the one the ad account uses |
| Server events but no browser events | Theme or consent banner blocking scripts | Test with the banner accepted; check the theme for script errors |
| Catalog ads show the wrong products | Content IDs in events do not match catalog IDs | Keep the catalog synced by the same channel that sends the pixel |
| ROAS in Meta far above Shopify revenue | Duplicate purchases or a long attribution window | Fix deduplication; compare against Shopify orders |
Duplicates are the most common Shopify problem, because stores change themes, agencies and apps over the years and each one leaves a pixel behind. Shopify warns that if you work with an agency or an app that manages Facebook ads or traffic, you should check that adding a pixel will not duplicate data. More detail: deduplication and pixel not tracking purchases.
App pixels, custom pixels and Customer events
Shopify manages tracking code in Customer events in the admin. There are two kinds: app pixels, installed by apps like the Facebook & Instagram channel, and custom pixels a developer adds by hand. Shopify recommends app pixels where one exists, because they update automatically and are more secure. For Meta, the channel's app pixel is the one to use. A custom Meta pixel on top of it is the second most common cause of duplicate purchases after leftover theme code.
What to do once tracking is clean
- Build audiences. Checkout starters who did not buy in the last 14 days are your best retargeting audience; the email half is in Shopify abandoned cart recovery.
- Optimize campaigns for Purchase once you have enough weekly purchases, and for AddToCart or InitiateCheckout until then.
- Recheck monthly. Compare Meta's purchase count against Shopify orders from Meta traffic. A sudden gap means something changed.
Where Sprites fits
Sprites checks Meta tracking for you from the ad account: events received in the last 7 and 28 days by name, browser versus server split, deduplication, Event Match Quality per event, when each event last fired, Meta's own diagnostics and the catalog match rate. It reports the fix in plain words, then builds audiences and campaigns on the clean data, with every change held for your approval. See Sprites for Meta ads.
FAQ
How do I add the Meta pixel to Shopify?
Install the Facebook & Instagram sales channel, then go to Sales channels, Facebook & Instagram, Settings, Data sharing settings. Turn on customer data sharing, choose a level, and connect an existing pixel or create a new one. Remove any pixel code previously pasted into your theme first.
What is the difference between Standard, Enhanced and Maximum data sharing?
Standard runs only the browser pixel, which ad blockers can stop. Enhanced adds the Conversions API, which sends the purchase event server to server along with customer name, location, email and phone for matching. Maximum does the same and also applies Meta's latest advertising technology.
Does Shopify support the Meta Conversions API?
Yes. Choosing the Enhanced or Maximum data sharing level in the Facebook & Instagram channel turns on the Conversions API. It sends the purchase event between Shopify and Meta servers, so browser ad blockers cannot drop it.
How do I test my Meta pixel on Shopify?
Open Meta Events Manager, select the connected dataset and use Test events with your store URL. Browse, add to cart and start checkout, then place a small real order. Confirm Purchase arrives with value and currency from both browser and server, and that the two copies are deduplicated.
Why is my Shopify Meta pixel counting purchases twice?
Usually because a second pixel is still installed: code pasted into theme.liquid, a pixel ID in Online Store Preferences, or a custom or app pixel added alongside the Facebook & Instagram channel. Remove everything except the channel connection, then check deduplication in Events Manager.
What events does the Meta pixel track on Shopify automatically?
Seven events: PageView, ViewContent, Search, AddToCart, InitiateCheckout, AddPaymentInfo and Purchase. Purchase fires when the order completes and the thank you page loads, and its value is the order total including duties, taxes and discounts.