To learn how to set up facebook pixel on shopify, you must install the official Facebook and Instagram app from the Shopify store. You connect your Meta account, select your pixel, and set your data sharing level to Maximum. This method requires no manual coding and turns on the Conversions API automatically.
When you understand how to set up facebook pixel on shopify correctly, your ad campaigns receive accurate data. Many store owners paste JavaScript directly into their theme files. You should never do this. Hardcoding the snippet causes duplicate events and broken metrics. You must use the official integration to track your customers properly.
Clean Up Your Existing Theme Code
If you previously pasted tracking scripts into your store, you must delete them. Having the manual script and the official app running together creates duplicate event reporting. Your ad manager will count one purchase as two. This ruins your return on ad spend data.
Before you install the new app, check if old tracking code is still firing by running your store address through a facebook pixel checker to see exactly which tracking scripts currently load on your pages. If it finds an active pixel, you need to remove the old code.
Go to your Shopify admin panel. Click on Online Store. Click on Themes. Find your current live theme and click the three dots next to it. Select Edit Code. Open the file named theme.liquid. Search for the word pixel or facebook. Highlight the entire block of code starting with the script tag and ending with the closing script tag. Delete it. Save your file.
Next, check your checkout settings. Go to Settings in your Shopify admin. Click on Checkout. Scroll down to the Order status page section. Look inside the Additional scripts box. If you see Meta tracking code here, delete it. Save your changes. Your store is now clean and ready for the official app.
Install The Facebook And Instagram App
Meta provides an official app to connect your store. You can find it in the Shopify app store. Search for Facebook and Instagram. Click Install. Shopify will prompt you to review the privacy details. Click Add sales channel to proceed.
You will see a setup screen. Click Start setup under the Facebook Ads section. The app will ask you to connect your personal Facebook account. This account must have admin access to your Meta Business Manager. Log in and grant the required permissions.
Next, connect your Business Manager account. A list of your available accounts will appear. Select the one that owns your store page and ad account. If you do not have a Business Manager, the app allows you to create one here.
Connect your Facebook Page. Select the page associated with your brand. Connect your Ad Account. Finally, the app will ask you to connect a pixel. If you already created one in your Meta Events Manager, select it from the list. If you have not, click Create new. The app will generate a new pixel for you.
Configure Your Data Sharing Settings
The most critical step in this process is selecting your data sharing level. Shopify gives you three options. These are Standard, Enhanced, and Maximum. You must understand what each level does.
The Standard setting uses a basic third party browser cookie. It tracks customer behaviour using the traditional Meta pixel. This setting is weak. Modern web browsers block third party cookies. Apple devices block tracking by default. If you choose Standard, you will lose a massive amount of data.
The Enhanced setting combines the browser pixel with Advanced Matching. It sends hashed customer information like names and email addresses. This helps Meta match a website visitor to a specific user profile. It improves your audience targeting.
The Maximum setting is the only option you should choose. Selecting Maximum automatically enables the Meta Conversions API. This technology bypasses browser blockers. It sends data directly from the Shopify server to the Meta server. This ensures your tracking remains accurate even when a browser blocks the client side pixel. Click the toggle to enable data sharing, select Maximum, and click Confirm.
Verify Your Live Tracking Events
After you finish the setup, you must verify that your store sends data correctly. Do not skip this step. You need to confirm that page views and purchases register in your ad account.
Open your Meta Business Manager. Go to the Events Manager. Select your pixel from the data sources list. Click on the Test Events tab. This tool allows you to see activity in real time.
Type your website address into the test events tool. Click Open Website. Your store will open in a new tab. Click around your website. View a product. Add the product to your cart. Initiate a checkout.
Go back to the Events Manager tab. You should see these actions appear on the screen. You will see a PageView event. You will see a ViewContent event. You will see an AddToCart event. If you selected the Maximum setting, you will see that these events come from both the browser and the server. Meta automatically deduplicates these events so they only count once.
You can read the official documentation on how to tell if your tracking works directly from the Meta Business Help Centre to understand your event logs in more detail.
Understand The Standard Shopify Events
The official Shopify app tracks specific actions automatically. You do not need to configure these manually. The integration handles the event mapping for you.
Here is a list of the standard events the app tracks:
- PageView: This fires on every page of your store. It tells Meta that a user loaded a page.
- ViewContent: This fires when a user looks at a specific product page. It sends the product ID and the price to your ad account.
- AddToCart: This fires when a visitor clicks your add to cart button. It helps you build retargeting audiences of people who showed high purchase intent.
- InitiateCheckout: This fires when a user clicks the checkout button and loads the payment screen.
- AddPaymentInfo: This fires when a customer enters their credit card details.
- Purchase: This is the most important event. It fires on the order confirmation page. It sends the exact order value to Meta. This allows you to calculate your return on ad spend.
Fix Common Setup Problems
Sometimes your setup will not work perfectly on the first try. You might see errors in your Events Manager. You need to know how to fix them.
If your events do not appear in the test tool, check your browser extensions. Ad blockers stop the pixel from firing. Turn off your ad blocker and test again. You should also test in an incognito window to ensure no extensions interfere with the tracking script.
If you see a warning about duplicate events, you likely have old code on your store. Go back and check your theme files again. You might have installed a third party tracking app in the past. Look through your app list and delete any old pixel apps. You can read more about resolving these specific errors in our guide on fixing a facebook pixel that is not working.
If your purchase events fail to register, you might have a conflict with a custom checkout app. The official integration works best with the native Shopify checkout. If you use a third party checkout processor, the standard app cannot track the final purchase. You will need a custom solution for that setup.
Upgrade Your Tracking Architecture
The native Shopify app is a great starting point. It provides a solid foundation for new stores. However, as your store grows, you will need more control over your data.
The official app sends data to Meta, but it does not connect to your other marketing platforms. If you run Google Ads or TikTok Ads, you have to install separate apps for each one. This slows down your website. Every new tracking script adds load time to your store. A slow store costs you sales.
You also lack control over exactly what data gets sent. The native app decides the payload for you. If you want to filter out specific products or modify the event parameters, you cannot do it through the basic app settings.
To solve this, you move your tracking off the browser entirely. You build a dedicated tracking server. Your website sends one stream of data to your server. Your server then distributes that data to Meta, Google, and any other platform you use. This makes your website incredibly fast. It also gives you total ownership of your data.
If you spend heavily on ads and need perfect data accuracy, you should consider upgrading to a custom server side tracking setup. This removes your reliance on third party apps and protects your tracking from browser updates.
Maintain Your Data Quality
Setting up your tracking is not a one time task. You must monitor your data quality regularly. Meta provides an Event Match Quality score in your Events Manager. This score tells you how well your server events match to real Facebook users.
A high score means your tracking is accurate. A low score means you are missing customer data. You should check this score once a week. If the score drops, you need to investigate your setup.
Keep your Shopify apps updated. Shopify frequently updates their platform architecture. The tracking app updates alongside these changes. If you ignore app notifications, your tracking might break.
If you need help auditing your current setup, you can always reach out through our contact page to have your systems reviewed. You can also review our pricing to understand how we structure custom tracking builds. Proper tracking is the only way to scale your advertising profitably.