← Back to blog
Store creation

How to Add the Facebook (Meta) Pixel and TikTok Pixel to Shopify, and Check They Track Purchases Correctly

Vincent Fredet·Founder of Scale Ova
Updated on ·15 min read
How to Add the Facebook (Meta) Pixel and TikTok Pixel to Shopify, and Check They Track Purchases Correctly

You're about to run your first ads, and someone told you to install the pixel first. Fair enough: without a pixel, Meta and TikTok can't see who buys after seeing your ad. They end up optimizing for clicks, and you can't tell which ad to keep and which to cut.

On Shopify, you can set it up in one sitting if you follow the order below. What really costs you is finding out, three weeks of ad spend later, that every purchase was counted twice.

What you need before you start

The pixel itself costs nothing: both apps are free, you only pay for your ads. You'll need:

  • For Meta: your Facebook account, a Facebook page for your brand and an ad account. The app offers to create whatever is missing.
  • For TikTok: a TikTok for Business account, a Business Center (the space that groups your accounts, your pixel and your catalog) and a TikTok Ads Manager account (where you build campaigns).
  • For testing: Shopify Payments test mode, which lets you place an order without a real payment. The shipping and payments guide shows where to turn it on.

If your store isn't set up yet, the complete guide to building a Shopify store walks through every step in order.

Step 0: check no pixel is already lying around

The same Meta pixel placed twice on your store, and every purchase counts double: your campaign looks twice as profitable as it is, and you raise the budget on false numbers.

If your store is brand new, skip ahead. If it has a history (a freelancer before you, a bought theme, apps you tried and forgot), check these four places:

Where to look How to check What you do
Installed apps Settings > Apps and sales channels: spot any pixel or tracking app (multi-pixel, "Facebook Pixel", "TikTok Pixel"), plus page builders and upsell apps with a "Pixel ID" field in their settings Keep only each platform's official app, and clear the "Pixel ID" fields of the others
Pixels registered with Shopify Settings > Customer events: the page lists app pixels and custom pixels Delete the custom pixel that duplicates an app
Theme code Online Store > Themes > Edit code, theme.liquid file: search for fbq( (Meta) or ttq. (TikTok) Duplicate the theme to keep a copy, then remove the block
Google Tag Manager If a GTM container is installed, open it and look for a Meta or TikTok tag Pause the tag, the official app takes over

If ads are already running on an old pixel, don't cut anything ahead of time. Note what you find, install the app and connect that same pixel (you keep its history and your audiences), then remove the old code right after: you avoid both hours with no purchase counted and a stretch where everything counts double.

Shopify's Customer events page, Custom pixels tab: an old Meta pixel still connected
A custom pixel that also sends the purchase to Meta duplicates the app: disconnect it.

Install the Facebook (Meta) pixel

Everything happens in the Facebook & Instagram app, published by Meta. It places the pixel across the whole store, checkout included, and it's the method Shopify documents.

  1. In the Shopify App Store, install Facebook & Instagram (developer: Meta). It's added to your sales channels.
  2. Connect your Facebook account, then pick or create your business portfolio, your page and your ad account.
  3. In the app, go to Settings > Data sharing settings. Turn on Customer data sharing, then pick a level under Choose level (see the table).
  4. Select your pixel or create one. In Meta Events Manager it's also called a "dataset".
  5. Confirm. The pixel runs on your store without a line of code from you.
The Facebook and Instagram app's data sharing settings: sharing on, Maximum level, pixel connected
Customer data sharing on, Maximum level, pixel connected: that's the setting to aim for.

The data sharing level is the choice that really matters. According to the Shopify Help Center:

Level What goes to Meta What can get lost
Standard The browser pixel, which shares your visitors' browsing behavior Anything an ad blocker or the browser blocks, purchases included
Enhanced The pixel, plus the purchase sent straight from Shopify's server to Meta's (the Conversions API), with the customer's name, location, email and phone Views and carts can still be blocked. The purchase gets through even when the browser blocks the pixel
Maximum The same customer data as Enhanced, and your store gets Meta's latest advertising technology as it's released Same as Enhanced

Pick Maximum. The purchase is the signal your campaigns need most, and from Enhanced up it also leaves from the server, without depending on your customer's browser. According to Shopify, Maximum sends the same customer information as Enhanced and adds Meta's new advertising features as they come out. The trade-off is real: you share your customers' personal data with Meta. Shopify asks you to say so in your privacy policy, so do it while you're at it.

Install the TikTok pixel

Same logic with the TikTok app: it creates the pixel, installs it and syncs your catalog.

  1. Install the TikTok app from the Shopify App Store. It's added to your sales channels.
  2. Connect your TikTok for Business account, then your Business Center and your TikTok Ads Manager account. The app offers to create them if they don't exist.
  3. Turn on data sharing and pick a level.
  4. Click Create Pixel, or select an existing pixel, fill in your business details and confirm.
  5. The catalog syncs on its own, for the primary market set in your store. It's used for ads that show your products, not to measure sales, so a rejected product doesn't block the pixel. You can track product approval in the app's catalog section.
The TikTok app's data sharing on Shopify: Enhanced level selected
Enhanced is the first level that also sends the purchase from the server.

TikTok's help describes three levels too:

Level What TikTok uses
Standard The TikTok pixel alone, sharing your visitors' browsing behavior
Enhanced The pixel, the Events API (server-side sending) and Advanced Matching (hashed email and phone, to recognize the buyer)
Maximum All of the above, plus Shopify APIs and a Shopify checkout shown inside TikTok's in-app browser (in beta)

Pick at least Enhanced: that's the level where the purchase is also sent from the server. Maximum adds Shopify APIs and a Shopify checkout shown right inside TikTok's browser, still in beta according to its February 2025 help. It isn't TikTok Shop.

Place an end-to-end test order

An installed app doesn't prove the purchase reaches Meta or TikTok. To find out, you place an order like a customer and watch what each platform receives.

Before you start:

  • turn on Shopify Payments test mode, or Shopify's test payment gateway if you don't use Shopify Payments (testing a payment requires a paid plan);
  • turn off your ad blocker for the test;
  • when the cookie banner shows, click Accept. In the European Economic Area and the UK, Shopify only runs pixels once the visitor has agreed: if you decline or ignore the banner, the test tool won't see anything from the browser.

Then:

  1. In Meta, open Events Manager, select your pixel, Test events tab. Enter your store address and open it from that screen.
  2. In TikTok, in TikTok Ads Manager, go to Tools > Events, open your pixel, then its test events tool.
  3. Browse the store like a customer: a product page, add to cart, checkout, purchase.

What you should see coming in, on each platform:

  • ViewContent when you open the product page;
  • AddToCart;
  • InitiateCheckout;
  • Purchase, only once, with the order amount and the right currency. On TikTok, the Shopify help still calls the purchase Complete Payment: if that's the name you see, it's your purchase.
Meta's Test events tool, Browser tab: a Purchase of 49.90 received in USD
The purchase arrives once, with the right amount and currency: that's what you want to see.

Once you're done, turn test mode off: while it's on, real customers can't pay by card.

The Server tab of the test tool only shows server events that carry its test code. To check server-side sending, look the next day in the Events Manager overview that the Purchase event arrives from both the browser and the server.

The Meta Pixel Helper and TikTok Pixel Helper Chrome extensions give a page-by-page preview. On Shopify, app pixels run in an isolated space of the page, so the extension doesn't always see everything. If the platform's test tool receives the events, trust the test tool.

In the ad dashboards, numbers show up more slowly: Shopify notes you need real customer activity before data appears. The live test is instant.

Two indicators to check after a few days

The test proves events are leaving. These two indicators tell you whether Meta and TikTok can actually use them.

Event Match Quality. Meta defines it as a score out of 10 showing how effective the customer information sent from your server is at matching an event to a Meta account. The higher it is, the better Meta ties your sales to your ads, and the better it finds people who look like your buyers. You'll find it in Events Manager, in the details of the Purchase event. On Shopify, your only real lever is the sharing level: at Standard, no customer information is sent from the server. If the score looks low on Maximum, don't make checkout fields mandatory to push it up: a customer who abandons their cart costs more than a point of score.

Deduplication. With the pixel and the Conversions API, the same purchase is sent twice: from the browser and from the server. That's on purpose. Meta recognizes the two with a shared event ID, generally keeps the first one received and discards the other, if they arrive within 48 hours. The official app sets that ID for you. The check is simple: over a week, the purchase count in Events Manager should match your online store's order count in Shopify or sit slightly below it (cookie refusals take a few away), not above it.

On TikTok, Events Manager shows the same markers in your pixel's overview: the Event Match Quality score, deduplication information in the event details, and a Diagnostics column that flags events to fix.

When the numbers don't add up

The most common gaps between what Meta or TikTok show and what Shopify says, and what to do about each:

What you see Likely cause What you do
Twice as many purchases in Meta as orders in Shopify The same pixel placed twice, often by the official app and by old code in the theme Go back to step 0, keep only the official app
Nothing reaches the test tool, not even views Cookie banner declined or ignored, or an ad blocker is on Accept cookies, turn off the blocker, try again
Views and carts come through, never the purchase Test order not completed, or data sharing turned off in the app Place a full test order again, check data sharing is on
The purchase shows a value of 0 Test order placed with a 100% discount Test with a real price, still in test mode
Fewer purchases on the ad side than orders Visitors declining cookies, ad blockers Partly normal. Server-side sending recovers purchases lost to ad blockers. A visitor who declines cookies has made a choice you don't work around
Meta claims more sales than your ads made Meta counts a sale when the person clicked or only saw your ad within a set period, and Meta, TikTok and Google can all claim the same order Keep Shopify as your reference and track your UTMs (below)

Old tutorial steps you can skip

Many tutorials, videos especially, predate several changes at Shopify and Meta. You can skip these three steps.

  • Pasting the pixel code into theme.liquid. The official app already places the pixel everywhere. Hand-added code duplicates it as soon as the app is installed, and Shopify notes that a pixel installed that way may need a third-party cookie banner or custom logic to respect consent.
  • Adding a conversion script to the thank you page (the old "Additional scripts" field in checkout settings). Shopify stopped running these scripts on August 26, 2026 for non-Plus stores (August 28, 2025 for Shopify Plus). If your old purchase tracking went through there, it has counted nothing since. The official app takes over, through Customer events.
  • Ranking your 8 events and verifying your domain to track conversions. Meta removed that screen: there are no events left to rank in Events Manager. Meta still recommends domain verification, but your pixel measures purchases without it.

If you sell in the EU or the UK, visitors must be able to refuse advertising cookies. France's CNIL, for example, requires refusing to be as easy as accepting.

Shopify runs its own cookie banner under Settings > Customer privacy. Pixels placed by apps go through Shopify's pixel system, which applies the visitor's choice. One more reason not to paste code by hand.

On a new store, this banner is on by default for visitors from the European Economic Area and the UK, as soon as you have an active market there. If you use another banner (Axeptio, Didomi or Cookiebot, for example), check that it's connected to Shopify's Customer Privacy API, as its help asks: that's what passes the visitor's choice to app pixels. When a visitor declines, pixels don't run in their browser: your ad numbers will sit a little below your real orders, and that's not a bug.

UTMs: know where your sales come from

Each platform counts sales by its own rules. UTMs give you your own version, read by Shopify in its reports.

Parameter What it says Example
utm_source The platform facebook, tiktok
utm_medium The traffic type paid_social
utm_campaign The campaign bottle_launch
utm_content The creative or its version problem_video_v2

All lowercase, always the same names, and never a customer's email or name in a URL. In Meta and TikTok, these parameters go at ad level, in the URL parameters field. On Meta, you can let the platform fill in the name: utm_campaign={{campaign.name}} picks up your campaign name, as long as you name it with the same rule. In Shopify, you'll find these sales in the marketing reports, grouped by UTM source and campaign. To read them afterwards without getting fooled by attribution, learn to read your campaign numbers in the right order.

What's next

Next step: your first Meta Ads campaign or your first TikTok Ads campaign. Still torn between the two? Choose your channel first.

No store yet? Scale Ova generates a complete Shopify store from your product. You can generate it, look around and edit it for free; only publishing it to Shopify takes a subscription. Once published, it's a Shopify store like any other: the Facebook & Instagram and TikTok apps install on it exactly as shown here.

FAQ

How do I add the Facebook pixel to Shopify?
With Meta's Facebook & Instagram app, from the Shopify App Store. In its settings, turn on data sharing, pick the Maximum level, then select or create your pixel. No code to paste.
How do I add the TikTok pixel to Shopify?
With the TikTok app, from the Shopify App Store. Connect TikTok for Business, your Business Center and your Ads Manager account, pick a data sharing level (at least Enhanced, for server-side sending), then click Create Pixel.
Do I need to verify my domain for the Meta pixel?
No, not to track conversions: Meta removed that step along with the 8-event ranking. It still recommends verification, but your pixel works without it.
Pixel or Conversions API: which one?
Both, and on Shopify you don't have to choose: the Enhanced and Maximum data sharing levels add the Conversions API to the pixel. The purchase arrives twice and Meta keeps one.
Should I keep my old pixel or create a new one?
Keep it if it's yours and has already run ads: it holds your purchase history and the audiences built on it. Select it in the app instead of creating one. A new pixel makes sense if the old one sits on a freelancer's account you no longer have access to.
Why can't Meta Pixel Helper find my pixel?
On Shopify, the app installs the pixel in an isolated space of the page that the extension doesn't always see. Trust Meta's test events tool.

Sources