This guide is about the event itself. If Purchase does fire but Meta's count stays below your orders, the cause is usually the browser losing some purchases, which is a different check.
How Purchase reaches Meta on Shopify
On most Shopify stores the Meta Pixel comes from the Facebook & Instagram sales channel. It adds the pixel through Shopify's Customer events, as an app pixel. Its data sharing settings, under Sales channels > Facebook & Instagram > Settings > Data sharing settings, decide what it sends. Other stores add Meta's code as a custom pixel in Customer events, in the theme, or in a Google Tag Manager container.
Shopify's documentation says app pixels run in a strict sandbox and custom pixels in a lax sandbox, an iframe that cannot read or change the page. That matters for testing and for the "fbq is not defined" error below.
Test it with one order
- 1In Meta Events Manager, open your pixel and go to Test events. Enter your store's address and open it from there, so your visit is marked as a test.
- 2Place a real order with a low price product, or use your store's test payment method if you have one set up.
- 3Finish the checkout and wait for the Thank you page to load fully. Do not close the tab early.
- 4Watch Test events. Note whether Purchase appears, whether it says browser, server or both, and the value and currency it shows.
- 5Open the Purchase event and check the event ID. If browser and server both arrive, they should carry the same ID.
- 6In Shopify admin, open Settings > Customer events and list every app pixel and custom pixel. Note which ones could send to Meta.
- 7Check your theme code and any Tag Manager container for Meta code that sends Purchase.
- 8Refund or cancel the test order afterwards, so it does not stay in your sales.
Meta's developer page also names a Chrome extension for checking the pixel, called Meta Ads Data Advisor on that page. Code inside Shopify's sandbox runs in a separate frame, so treat Test events in Events Manager as the check that counts.
What the result tells you
No Purchase at all, and no PageView either. The pixel does not load. Check that the Facebook & Instagram channel is connected to the right pixel, that customer data sharing is on, and that your consent banner did not block it. Shopify says that in markets that require consent, pixels run only when the visitor has given the permissions the pixel needs, so test once with cookies accepted.
PageView arrives, Purchase does not. The pixel loads, but nothing sends Purchase on the last step. A custom pixel must subscribe to Shopify's checkout event and call Purchase itself. Shopify's guide for adding Meta's code as a custom pixel says Meta's pixel code does not send data from a custom pixel on its own. Old purchase code in the additional scripts of the Thank you page may no longer run after Shopify's move to the newer Thank you and Order status pages.
Purchase arrives from the server only. The browser pixel did not fire Purchase, but a server connection did. That can be fine, as long as nothing else also sends it.
Purchase arrives twice with different event IDs. Two senders report the same order. Meta treats a browser and a server event as one only when the event name and the event ID match, and its documentation says this works within 48 hours. Keep one sender, or give both the same ID.
Purchase arrives with the wrong value or currency. The event fires. The code that fills the value reads the wrong field, for example a total with shipping when your other reports use the subtotal.
What "fbq is not defined" means
fbq is the function Meta's base code creates. Meta's developer page says the base code downloads a library of functions you then use for conversion tracking, and recommends placing it in the head of every page you track. The browser shows "fbq is not defined" when some code calls fbq before the base code has run on that page, or when the base code is not on that page at all.
On Shopify the usual reasons are:
- A theme snippet calls fbq, but the pixel comes from an app or a custom pixel. In that case Meta's code may run inside Shopify's sandbox and not on the page itself, so the snippet finds nothing. Move the event into the same place as the pixel, or remove the snippet if the app already sends it.
- The event code runs before the base code. A tag in Tag Manager with an earlier trigger, or a snippet placed above the base code, calls fbq too soon. Make the event tag wait for the base code.
- A consent tool holds the base code back. Some consent tools delay scripts until the visitor answers. An event that runs before that answer fails. This is expected for a visitor who declined, and the purchase should not be sent for that visitor.
- Code pasted into a custom pixel with its HTML wrapper. Shopify says its sandbox supports only JavaScript, so the script tags must come out and the code must stay.
An ad blocker usually shows up differently: the library file fails to load in the browser's Network tab, and no request reaches Meta.
If the pixel can't be fixed for every shopper, how a server sends purchases Safari blocks is the other route.
FAQ
Is the error a problem for my shoppers?
No. They can still buy. The error only means that this piece of tracking code did not run, so Meta may not get that event from the browser.
Why does Test events show Purchase but Ads Manager shows fewer?
Test events shows what arrived. Ads Manager credits purchases to ads by its attribution rules, and it can take hours to show them.
Should I add the pixel code to my theme as well?
Only if you know nothing else sends the same events. A second copy usually means purchases counted twice.
Do I need a developer for this?
For the test and the Customer events list, no. For code in the theme or in Tag Manager, often yes.
What Tikra's free diagnosis shows
Your paid orders of the last 7 full days, how many came from a Meta, Google or TikTok ad, and, after a full day and 10 paid online orders, how many your shoppers' browsers reported. With a key that can read your pixel's statistics, it also shows Meta's count and flags when Meta misses purchases or gets none from a server. It sends none of your orders anywhere.
With a plan, Tikra sends a Purchase event for each paid online order from our server, so the purchase does not depend on code running on the Thank you page. Meta starts in a check before sending. With a key that can read your pixel's statistics, Tikra reads Meta's own count every day for at least 48 hours and shows whether another connection still sends your purchases; with another key, sending starts after you turn the store's own Meta purchase tracking off and confirm it on the Meta card. Tikra applies your customers' consent choices to every order, and in Strict mode an order is sent only with the buyer's consent. A written guarantee in our Terms covers eligible orders: at least 97 % reach each platform, fixed within 12 hours or a month's fee credited (Terms of Service, section 8).