Guide · Tracking and data
Meta pixel and Conversions API on Shopify: the complete setup
Set up the Meta pixel and Conversions API on Shopify: the three ways to do it, step by step, how to verify it in Events Manager and why Meta misses orders.
- The Meta pixel reports what shoppers do in the browser; the Conversions API sends the same events from a server, so orders still arrive when the pixel is blocked.
- Meta recommends using both, with the same event name and event id on each copy so it counts every event once.
- On Shopify you can set it up with the Facebook & Instagram app (Enhanced or Maximum data sharing), through server-side Google Tag Manager, or with a tracking app that sends orders from the shop's order data.
- Verify the setup in Events Manager: events arriving from both sources, deduplication, event match quality, and Test events before you rely on it.
- Most missing conversions come from blocked pixels, declined consent, purchases that depend on the thank-you page, and duplicate senders.
Meta's ad system decides whom to show your ads to based on the purchases you report. On Shopify, two tools report them: the Meta pixel in the shopper's browser and the Conversions API from a server. This guide explains what each does, the three ways to set them up on a Shopify store, how to check the result in Events Manager, and what to fix when Meta still shows fewer orders than your shop.
For the technical detail of a single Conversions API request (fields, hashing, errors), read our Meta Conversions API guide. This page is about getting it right on Shopify.
The terms you need first
| Term | What it means |
|---|---|
| Meta pixel | A script from Meta that runs in the shopper's browser and sends events such as PageView, AddToCart and Purchase. |
| Dataset | Meta's current name for the container that receives your events. A pixel id is a dataset id. |
| Conversions API (CAPI) | Meta's server-to-server interface. Your server, an app or Shopify posts the same events to Meta directly. |
| Browser-side and server-side | Where an event is sent from: the visitor's browser (pixel) or a server (Conversions API). |
| Standard events | Meta's predefined event names: ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, Purchase and others. |
| Event id | An id on each event. When the pixel and the server send the same event name with the same id, Meta keeps one. |
| _fbp and _fbc | Meta's first-party cookies: the browser id, and the click id built from fbclid when someone arrives from an ad. |
| Event match quality (EMQ) | A score from 0 to 10 per event in Events Manager for how well the customer details you send let Meta match the event to an account. |
| Catalog (product feed) | Your product list in Meta Commerce Manager. Product ids in your events must match it for dynamic ads. |
Pixel and Conversions API: what each one does
- Sees page views, product views and adds to cart as they happen
- Sets and reads the _fbp and _fbc cookies
- Is stopped by ad blockers, some browsers and declined consent
- Misses the purchase when the thank-you page does not load
- Sends events from the shop's server or an app
- Not affected by ad blockers or a closed tab
- Can send the paid order from the order data itself
- Needs customer details and click ids passed along to match well
What Meta conversion tracking actually does
When tracking works, every Shopify order from a Meta ad reaches Meta with a value, a currency, the products and enough identifiers to tie it to the click or the impression. Meta then credits the ad, reports ROAS in Ads Manager, adds the buyer to custom audiences, and uses the purchase as a learning signal for campaigns that optimise for purchases or purchase value.
Why Meta misreports conversions on Shopify
Ads Manager rarely matches Shopify exactly, and some difference is normal: Meta attributes by its own window (by default 7 days after a click or 1 day after a view), dates a conversion by the ad interaction, and can credit an order that another channel also claims. But a store that sees Meta report clearly fewer purchases than it had from Meta traffic usually has one of these problems:
- A browser-only setup. Ad blockers, Safari and Firefox tracking protection and in-app browsers stop the pixel or shorten its cookies.
- Purchases that depend on the thank-you page. When the shopper closes the tab after paying, or pays through an external redirect, the browser event never fires.
- Declined consent. In regions with a consent banner, visitors who decline do not load the pixel.
- Low match quality. Server events without email, phone, click id, IP address and user agent cannot be matched to an account.
- Duplicate senders. The opposite problem: two apps sending the same pixel inflate purchases. See duplicate purchase events.
Basic pixel tracking was enough when browsers kept cookies for years and nobody blocked scripts. That is no longer the case, which is why a server route matters for every store that advertises on Meta.
The three ways to set up Meta tracking on Shopify
| Method | How it works | Good for | Watch out for |
|---|---|---|---|
| Facebook & Instagram app (Shopify's Meta channel) | Install the app, connect your Business Manager and pixel, choose a data sharing level. Enhanced and Maximum add the Conversions API. | Most stores; no code | Little visibility into what was sent; the app must be the only sender of that pixel |
| Google Tag Manager with a server container | A web container sends events to your own server container, which forwards them to Meta's Conversions API. | Teams that already run GTM | Hosting and maintaining the server container; checkout runs in Shopify's pixel sandbox |
| Tracking app sending from order data | An app reads paid orders from Shopify's webhooks and sends them to the Conversions API, with click ids captured on the storefront. | Stores that want orders sent even when the browser fails, with a delivery log | Turn off other senders of the same pixel, or share one event id with them |
Swipe the table sideways to see every column.
Data sharing levels in the Facebook & Instagram app
Shopify's Meta app offers three customer data sharing levels. Standard uses the pixel only. Enhanced adds the Conversions API for the purchase event and shares customer information for matching. Maximum builds on Enhanced with the rest of Meta's server-side features. You change the level in the app's settings under data sharing.
What you need before you start
- Admin access to the Meta Business Manager (Business portfolio) that owns the ad account and the dataset.
- The dataset (pixel) id you want to use. Use one dataset per store, not a new one per app.
- Your shop domain verified in Business Manager under Brand safety › Domains.
- Staff access with app permissions in Shopify admin.
- An inventory of every place the pixel is installed today: the theme code, Shopify's old additional scripts, other apps, Google Tag Manager.
- A cookie banner connected to Shopify's Customer Privacy API if you sell in the EU, the UK or Switzerland.
Step by step: the native Shopify integration
- Install the Facebook & Instagram app
Add Shopify's Meta sales channel from your Shopify admin and log in with the Facebook account that has admin rights on your Business Manager.
- Connect your assets
Choose the Business Manager, the Facebook page, the ad account and the dataset (pixel). Pick the dataset your ads already optimise on, so their learning carries over.
- Turn on data sharing
In the app's settings, turn on customer data sharing and choose Enhanced or Maximum to add the Conversions API.
- Remove other copies of the pixel
Delete pixel code from theme.liquid and from any other app that sends the same dataset, unless it shares the event id.
- Place a test order
Use a real product and a discount code, then cancel and refund it. Check that Events Manager shows the purchase from both browser and server.
The Conversions API explained
A Conversions API event is an HTTPS request with the event name, its time, the source (website), the page address, the user agent, customer information and custom data such as value, currency and product ids. Meta requires event_name, event_time, action_source and customer information on every event, and for website events also event_source_url and client_user_agent.
Deduplication
If the pixel and the server both send a Purchase, Meta keeps one copy when the event name and the event id match and both arrive within 48 hours. The id must be the same string on both sides; an order-based id such as order-6123456789012 works because both the checkout and the server know the order.
// Browser: the pixel's Purchase with an event id
fbq('track', 'Purchase', { value: 86.00, currency: 'EUR' }, { eventID: 'order-6123456789012' });
// Server: the same event in the Conversions API payload
{ "event_name": "Purchase", "event_id": "order-6123456789012", "action_source": "website", ... }What raises event match quality
Meta matches server events with the customer information you send. The more of these it gets, the more events it can match. Meta's documentation lists them; the table shows which ones a Shopify order can supply.
| Parameter | Field | Where it comes from on Shopify |
|---|---|---|
| Email (hashed) | em | The order or the checkout contact step |
| Phone (hashed) | ph | The order, when the shopper gives one |
| Name, city, postcode, country (hashed) | fn, ln, ct, zp, country | The billing or shipping address |
| Click id | fbc | The fbclid on the landing page, kept with the visitor |
| Browser id | fbp | The _fbp cookie |
| IP address and user agent | client_ip_address, client_user_agent | The shopper's browser, recorded with the order (not your server's) |
| External id | external_id | Your own customer or visitor id, the same on browser and server events |
Swipe the table sideways to see every column.
| Pixel only, visitor with an ad blocker | No event |
|---|---|
| Server event with IP address and user agent only | Weak match |
| + hashed email and phone from the order | Stronger match |
| + fbc from the ad click and fbp from the cookie | Strongest match, tied to the click |
First-party data with the Conversions API
- Collect it on your own domain
Capture the fbclid and UTM tags on the landing page with a script served from your shop's domain, and keep them with a first-party visitor id.
- Carry it to the order
Write the visitor id and click values to the cart, so Shopify copies them onto the order and they arrive with the order webhook.
- Send it from the server
Build the Conversions API event from the order, add the stored click values and the hashed customer details, and send it.
- Respect the visitor's choice
Read the consent state and send only what it allows. The Conversions API is a route, not a legal basis.
What server-side tracking is not
- Not a reason to drop the pixel. Meta still recommends both; the pixel adds browser signals.
- Not a way around consent. Sending from a server does not change what the law requires. Our GDPR guide for Shopify covers the rules.
- Not a fix for duplicates. More senders without a shared event id make the count worse.
- Not every event needs it. The purchase matters most. Page views from a server add little that the pixel does not already send.
Verify your setup in Events Manager
- Check the dataset
Open Events Manager and select the dataset. Confirm it is connected to the right ad account and that your Shopify domain is listed.
- Check that events arrive
On the overview, look for ViewContent, AddToCart, InitiateCheckout and Purchase. For each, Meta shows whether it came from the browser, the server or both, and when it last arrived.
- Use Test events
Open the Test events tab, enter your store address or send server events with the test code, and place an order. Remove the test code afterwards: test events are not dropped and count like real ones.
- Check event match quality
Open the Purchase event and read the match quality and which customer parameters are received, and from which source.
- Confirm deduplication
The event details show how many browser and server events were received and how many were deduplicated. Purchases received should roughly equal orders, not double them.
- Check the event configuration
Meta has changed Aggregated Event Measurement several times since iOS 14.5. If Events Manager still shows an event configuration for your domain, make sure Purchase is in it.
Troubleshooting the pixel and the Conversions API
| What you see | Likely cause | What to do |
|---|---|---|
| Purchases far below orders | Pixel only, or server events failing | Turn on the Conversions API; check the server log or app for rejected events |
| Purchases above orders | Two senders, or no shared event id | Find every sender of the dataset; remove one or align the event ids |
| "Server events missing parameters" warnings | Server sends its own IP and user agent, or no email | Pass the shopper's IP and user agent and hashed contact details from the order |
| Low match quality on Purchase | No fbc, no email or phone | Store fbclid on landing and pass it with the order; add hashed contact details |
| Events from an old domain | Pixel installed on another site too | Use a separate dataset per site, or filter traffic in Events Manager |
| Purchases with value 0 | Value missing or sent as text | Send value as a number with a currency code |
| No events after a token change | Expired or revoked access token | Generate a new token in Events Manager settings and update the sender |
Swipe the table sideways to see every column.
Meta ads data in Google Analytics
Google Analytics does not import Meta's data. It only sees Meta traffic by its UTM tags. Without them, visits from Instagram and Facebook arrive as referral or direct traffic and their orders cannot be compared with Ads Manager. Add a URL parameter template to every ad, for example utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_content={{ad.name}}. Our post on UTM parameters for Meta and TikTok lists the dynamic values. Even then, GA4 credits orders differently from Meta, so the two will not match; read GA4 tracking problems on Shopify for why.
Common mistakes on Shopify
- A half-finished setup. A pixel from the theme plus the Meta app plus another app, none of them configured fully.
- No UTM tags. Without them you cannot check Meta's numbers against any other source.
- Missing permissions for automatic advanced matching. Without it the pixel cannot pick up email and phone from forms; check it is on in the dataset settings where you want it.
- One dataset per app. A new pixel for every tool splits your purchase history, and campaigns lose their learning.
- A test code left in production. Test events still count. Remove the code once you have finished testing.
- Ignoring health restrictions. In health and wellness categories Meta limits which events and parameters it accepts; see Meta's health and wellness restrictions.
- Assuming "some purchases show up" means it works. Compare counts every week.
How ROASaurus sends Meta events on Shopify
ROASaurus sends each paid Shopify order to Meta's Conversions API from the order data, 20 seconds after payment, with the click id captured first-party on your own domain and the customer's details hashed with SHA-256. Page views, product views, adds to cart and checkout starts are sent too. The Meta pixel in the browser is optional; when it is on, both copies share one event id (order- plus the order id for a purchase). Meta is one of the destinations ROASaurus runs in production today.
Connections › Tracking & destinations- Install the ROASaurus Shopify app; it registers the order webhooks and the checkout pixel.
- Add the Meta destination: connect with Facebook and pick the ad account and dataset, or paste the dataset id and a Conversions API access token from Events Manager.
- Tick "Also load the browser pixel" if you want the pixel next to the server events, and turn off the Facebook & Instagram app's data sharing for the same dataset so it has one sender.
- Optionally paste a test event code while you test, and remove it afterwards.
- Check Data quality › Overview for Meta's accuracy (accepted against expected orders), the match keys sent and event match quality, and Data quality › Deliveries for each event with Meta's answer.

With the default consent mode, a visitor who declined marketing cookies gets no browser pixel and no stored click id; the paid order is still sent to Meta server-side with the order's customer details hashed and without a click id.
Start freeOpen the live demo14-day trial of every feature, no credit card.

Sources
- Meta for Developers: Conversions API
- Meta for Developers: Handling duplicate pixel and Conversions API events
- Meta for Developers: Customer information parameters
- Shopify Help Center: Facebook data sharing
- Shopify Help Center: Meta pixel