Meta setup guide

How to add the Facebook pixel (Meta pixel) to Shopify

The Facebook pixel is now the Meta pixel. On Shopify you add it in one of three ways: the Facebook & Instagram channel, a custom pixel under Settings > Customer events, or an app such as WeProfit. Pick one tool to send events to each Pixel ID, add the Conversions API for server events, and test one purchase from start to finish.

What the Meta pixel does on a Shopify store

The Meta pixel, formerly the Facebook pixel, is Meta’s JavaScript code that tracks what visitors do on your store: viewing pages and products, adding to cart, starting checkout and buying. Meta uses these events to measure your ads and to build audiences for targeting. Each pixel has a Pixel ID, which Events Manager may also show as a dataset ID.

The pixel runs in the shopper’s browser. Shopify notes that ad blockers can block a web pixel entirely, while Shopify’s own reports and order records are not affected. Meta’s Conversions API sends events from a server instead, and Meta recommends using it in addition to the pixel, with the same Pixel ID for browser and server events.

Common store events and the Meta events they become
Store eventMeta event
Page viewPageView
Product viewViewContent
Add to cartAddToCart
Checkout startedInitiateCheckout
Payment information addedAddPaymentInfo
PurchasePurchase

Where pixels run on Shopify now

Shopify manages pixels under Settings > Customer events. App pixels are added by apps and sales channels. Custom pixels are code you paste in yourself, and Shopify runs them in a sandbox where not every pixel feature works. A Meta pixel that sat in the Online Store preferences, rather than in the Facebook & Instagram channel, was removed from there in February 2025 and converted into a custom pixel under Customer events.

The checkout pages changed as well. Shopify has replaced the old Thank you and Order status pages: Shopify Plus stores lost checkout.liquid and additional scripts there on August 28, 2025, and other plans had until August 26, 2026, after which Shopify upgraded the remaining stores automatically. Additional scripts are not supported on the new pages, and the additional scripts box in Settings > Checkout has been view-only since August 28, 2025.

Pixel code pasted into your theme still loads on storefront pages. Shopify asks you to remove pixel code from theme.liquid before you add a Pixel ID in the Facebook & Instagram channel, and to remove or change existing pixels before you add a custom pixel, so customer events are not counted twice.

Three ways to add the Meta pixel to Shopify

Each route can send events to the same Pixel ID, so choose one as the sender for that pixel. They differ in who maintains the code and whether events also go from a server.

The next section walks through the channel. A custom pixel is code you paste in and maintain yourself, and Shopify’s help pages explain how to add one. The rest of this guide covers the third route with WeProfit, then how to keep one sender per pixel and how to test.

Ways to add the Meta pixel to a Shopify store
RouteHow you add itWhat it sends
Facebook & Instagram channelAdd the Facebook & Instagram sales channel and connect your Meta business assets, then in its settings turn on data sharing, choose a level and select your pixelBrowser events from the Meta pixel; at the Enhanced and Maximum levels, Shopify says the Conversions API also sends the purchase event between Shopify’s and Meta’s servers
Custom pixelIn Settings > Customer events, add a custom pixel, paste your Meta pixel code, select Save, then Connect pixelOnly the events your code subscribes to; Shopify does not support custom pixel code, so you maintain it
An app that sends browser and server events, such as WeProfitWith WeProfit: install the app, switch on its app embed in the theme editor, then connect your Pixel ID and a Conversions API access tokenWith WeProfit: storefront events from the browser, paired with server copies, plus checkout events and purchases from WeProfit’s server

Add the Meta pixel with the Facebook & Instagram channel

Shopify’s Facebook & Instagram sales channel connects your store to your Meta business portfolio, and its data sharing settings decide whether it sends events to your pixel. Shopify says the staff member who connects it needs full control of the business portfolio and the Facebook Page linked to the store.

  1. If you pasted Meta pixel code into theme.liquid, remove it first: Shopify asks you to remove it before you can add a Pixel ID in the channel, because two copies of the pixel can give duplicate or incorrect data.
  2. In your Shopify admin, open Settings > Sales channels and add Facebook & Instagram from the Shopify App Store. Select Connect account, sign in to Facebook, connect your Meta business assets, accept the terms and select Finish setup.
  3. Go to Sales channels > Facebook & Instagram, select Settings and open the data sharing settings.
  4. Turn on data sharing and choose a level. Standard uses the Meta pixel only. Enhanced and Maximum add the Conversions API, which Shopify says sends the purchase event between Shopify’s and Meta’s servers, and share customer details such as name, email address and phone number.
  5. Select your pixel from the list, then select Confirm.

Connect Meta in WeProfit: Pixel ID and access token

WeProfit sends store events to Meta from its server through the Conversions API, and on Shopify its app embed also loads the Meta pixel you connect on your storefront pages. You need two values from Meta Events Manager: the Pixel ID and a Conversions API access token.

With the pixel connected and the app embed on, Meta receives PageView, ViewContent and AddToCart from the browser and from WeProfit’s server under the same event IDs, and InitiateCheckout, AddPaymentInfo and Purchase from the server only. The Purchase is built from Shopify’s order webhook, once per order and pixel, with the order total and currency, the buyer’s hashed email, phone, first and last name, city, state, ZIP, country and external ID, plus the IP address and user agent and the fbp and fbc browser IDs when known. Refunds are not sent to Meta.

On WooCommerce (beta), WeProfit loads no Meta browser pixel and sends Meta events from its server only.

  1. In Meta Events Manager, select Data sources and open your website’s pixel, which Meta may call a dataset. On its Settings tab, copy the Dataset ID: this is your Pixel ID.
  2. On the same tab, scroll to Conversions API and, under Set up manually, select Generate access token. Copy the token right away, because Meta shows it only once. Meta shows this link only to people with developer access to the business that owns the pixel.
  3. In WeProfit, open Ad Networks > Meta and select Add pixel. Enter the Pixel ID and the CAPI access token, and add a label if you connect more than one pixel.
  4. Leave the conditions empty to send every event to this pixel, or add conditions such as country, event, order value or campaign to limit what it receives. Then select Connect pixel.
  5. Open Installation and check that App embed (storefront tracking) reads Active. If it does not, select Open theme editor, check that WeProfit is switched on under App embeds and select Save.
  6. Select Send test on the pixel card. WeProfit does not test the token when you save, so this is the first check: it sends a PageView through the Conversions API and shows Meta’s answer. Without a test event code, that PageView is a live event on the pixel.

Avoid double purchases: one sender per Pixel ID

Meta’s recommended way to count a browser event and a server event once is the same event name and event ID on both, received within 48 hours of the first one. Tools that send to the same pixel with their own IDs give Meta separate events, so one order can show up as two purchases.

WeProfit pairs its own events: its storefront browser events carry the same IDs as their server copies, and each order’s Purchase goes to a pixel once, from the server, with an ID built from the order, such as pur_a1b2c3d4-6012345678901. The Facebook & Instagram channel, a custom pixel or theme code uses its own IDs, which do not match WeProfit’s.

After a few days of orders, compare Meta’s purchases with your Shopify orders for the same days, and read the Event Deduplication tab in the Purchase event’s details in Events Manager.

  • Using WeProfit for a Pixel ID: stop the Facebook & Instagram channel, custom pixels and theme code from sending to that same pixel, so it has one browser sender and one purchase sender.
  • Keeping the Facebook & Instagram channel as the sender: do not connect the same Pixel ID in WeProfit. WeProfit has no per-pixel server-only option; the store-wide Browser tracking switch removes its Meta pixel but also stops all storefront tracking.
  • Running two different pixels on purpose is fine, as long as each Pixel ID has one browser sender and one purchase sender.

Test with Meta’s Test events and the CAPI delivery log

Browser extensions such as Meta Pixel Helper only see events fired in the browser, so they never show a server event such as WeProfit’s Purchase. Use Meta’s Test events and WeProfit’s CAPI delivery log for server events, and the Shopify Pixel Helper for pixels under Settings > Customer events.

  1. In Events Manager, open your pixel’s Test events tab and copy the test code Meta shows for server events.
  2. In WeProfit, edit the pixel, paste the code into Test event code and save, then select Send test. The PageView should appear in Test events, and WeProfit shows Test event accepted by Meta with the number of events received.
  3. Browse your store as a shopper: open a product and add it to the cart. While the code is set, WeProfit sends every live event of that pixel with it, so these events show in Test events too.
  4. Place a test order. WeProfit counts a Shopify test order and sends it to your connected ad networks like a real order, and cancelling it later does not withdraw the Purchase.
  5. Find the Purchase in WeProfit’s CAPI delivery log. The log shows WeProfit’s event ID, such as pur_6012345678901, and Meta shows it with a store code, such as pur_a1b2c3d4-6012345678901. The log has no value column: check the value on the Events page, or open the event in Test events.
  6. Clear the test event code when you finish. Meta asks for the code to be used for testing only, and WeProfit turns it off by itself 24 hours after you set it.

Pixel added but no purchases in Ads Manager?

Check Events Manager first. If Purchase events arrive there, Meta has them, and the question is attribution: Ads Manager shows only the purchases Meta credits to your ads under each ad set’s attribution setting. If no purchases arrive, the problem is the sender: a wrong Pixel ID, a disconnected pixel, or code that stopped on Shopify’s new Thank you page.

The troubleshooting checklist walks through each check in order, from one real order to the CAPI delivery log.

Related platform documentation

A LITTLE MORE CLARITY

Good questions.
Clear answers.

Have something else in mind?

Talk to our team

Yes. The Facebook pixel was renamed the Meta pixel, and Events Manager may also call it a dataset: the Dataset ID on the pixel’s Settings tab is your Pixel ID. Older guides and apps that say Facebook pixel mean the same pixel and the same ID.

Give your ads better conversion data.

All 10 networks included. Plans from $19/month per store.

Start your 14-day free trial