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.

Updated · 13 min read

By the ROASaurus team

The short answer
  • 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

TermWhat it means
Meta pixelA script from Meta that runs in the shopper's browser and sends events such as PageView, AddToCart and Purchase.
DatasetMeta'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-sideWhere an event is sent from: the visitor's browser (pixel) or a server (Conversions API).
Standard eventsMeta's predefined event names: ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, Purchase and others.
Event idAn id on each event. When the pixel and the server send the same event name with the same id, Meta keeps one.
_fbp and _fbcMeta'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

Meta pixel (browser)
  • 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
Conversions API (server)
  • 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
Meta recommends running both and deduplicating them. Neither one alone gives Meta the full picture.

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

MethodHow it worksGood forWatch 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 codeLittle visibility into what was sent; the app must be the only sender of that pixel
Google Tag Manager with a server containerA web container sends events to your own server container, which forwards them to Meta's Conversions API.Teams that already run GTMHosting and maintaining the server container; checkout runs in Shopify's pixel sandbox
Tracking app sending from order dataAn 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 logTurn off other senders of the same pixel, or share one event id with them
Pick one method per pixel. Mixing them without a shared event id double counts.

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

Before setting up Meta tracking
  • 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

  1. 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.

  2. 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.

  3. Turn on data sharing

    In the app's settings, turn on customer data sharing and choose Enhanced or Maximum to add the Conversions API.

  4. 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.

  5. 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.

One event id on both copies
// 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.

ParameterFieldWhere it comes from on Shopify
Email (hashed)emThe order or the checkout contact step
Phone (hashed)phThe order, when the shopper gives one
Name, city, postcode, country (hashed)fn, ln, ct, zp, countryThe billing or shipping address
Click idfbcThe fbclid on the landing page, kept with the visitor
Browser idfbpThe _fbp cookie
IP address and user agentclient_ip_address, client_user_agentThe shopper's browser, recorded with the order (not your server's)
External idexternal_idYour own customer or visitor id, the same on browser and server events
Hash email, phone and address fields with SHA-256 after normalising them (lower case, no spaces, phone with country code). Do not hash IP address, user agent, fbp or fbc.

Swipe the table sideways to see every column.

Match keys on one purchase, ROASaurus Demo StoreSample data
Pixel only, visitor with an ad blockerNo event
Server event with IP address and user agent onlyWeak match
+ hashed email and phone from the orderStronger match
+ fbc from the ad click and fbp from the cookieStrongest match, tied to the click
Example data for a fictional order. Meta shows the resulting event match quality per event in Events Manager; the score depends on your whole traffic, not one order.

First-party data with the Conversions API

  1. 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.

  2. 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.

  3. 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.

  4. 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

  1. 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.

  2. 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.

  3. 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.

  4. Check event match quality

    Open the Purchase event and read the match quality and which customer parameters are received, and from which source.

  5. 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.

  6. 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 seeLikely causeWhat to do
Purchases far below ordersPixel only, or server events failingTurn on the Conversions API; check the server log or app for rejected events
Purchases above ordersTwo senders, or no shared event idFind every sender of the dataset; remove one or align the event ids
"Server events missing parameters" warningsServer sends its own IP and user agent, or no emailPass the shopper's IP and user agent and hashed contact details from the order
Low match quality on PurchaseNo fbc, no email or phoneStore fbclid on landing and pass it with the order; add hashed contact details
Events from an old domainPixel installed on another site tooUse a separate dataset per site, or filter traffic in Events Manager
Purchases with value 0Value missing or sent as textSend value as a number with a currency code
No events after a token changeExpired or revoked access tokenGenerate 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.

In ROASaurusConnections › Tracking & destinations
  1. Install the ROASaurus Shopify app; it registers the order webhooks and the checkout pixel.
  2. 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.
  3. 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.
  4. Optionally paste a test event code while you test, and remove it afterwards.
  5. 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.
The ROASaurus Mac app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
The ROASaurus iPhone app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
Data quality › Overview: accuracy per ad platform, missed orders and match keys. Fictional demo store, simulated data.

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.

The ROASaurus Mac app showing Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.
The ROASaurus iPhone app showing Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.
Data quality › Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.

Sources

  1. Meta for Developers: Conversions API
  2. Meta for Developers: Handling duplicate pixel and Conversions API events
  3. Meta for Developers: Customer information parameters
  4. Shopify Help Center: Facebook data sharing
  5. Shopify Help Center: Meta pixel

More guides on tracking and data · All guides

FAQ

Questions, answered

More answers in the FAQ and the help center.

What is the Facebook pixel on Shopify?

It is Meta's browser script, now called the Meta pixel or dataset, installed on a Shopify store to report page views, adds to cart and purchases to Meta. On Shopify it is usually installed by the Facebook & Instagram app or a tracking app.

How do I set up the Meta pixel on Shopify?

Install the Facebook & Instagram app, connect your Business Manager, ad account and dataset, and turn on customer data sharing. Or add the dataset to a tracking app. Remove any other copy of the pixel and test with a real order.

Do I need both the pixel and the Conversions API?

Meta recommends both. The pixel adds browser signals such as the _fbp cookie; the Conversions API delivers events the browser misses. Send the same event name and event id from both so Meta counts each event once.

Which Shopify data sharing level should I choose?

Standard is pixel only. Enhanced adds the Conversions API for purchases and shares customer information for matching; Maximum adds Meta's further server-side features. For most stores that advertise on Meta, Enhanced or Maximum is the minimum.

Why does Meta show fewer purchases than Shopify?

Partly attribution: Meta only counts orders within its window after an ad interaction. Beyond that, blocked pixels, declined consent, closed thank-you pages and low match quality on server events cause real loss.

Why does Meta show more purchases than Shopify?

Usually two senders of the same pixel without a shared event id, so each order counts twice. It can also be view-through credit for orders that came through other channels.

How do I check that my Conversions API works?

In Events Manager, open the Purchase event and check that it arrives from both browser and server, that events are deduplicated, and the match quality. Use Test events with a test order first.

Is my Shopify store GDPR compliant if I use the Conversions API?

Server-side sending does not change what consent rules require. Whether you may send an order of a visitor who declined is a legal question; ask your privacy adviser and configure your tracking to match.

Does Shopify Plus need a different setup?

No. The pixel and the Conversions API work the same on every plan. Since checkout extensibility, scripts on checkout pages run as Shopify pixels on every plan, Plus included.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.