How to set up Facebook pixel on Shopify: Our Expert Guide 2026
- What is Facebook Pixel? How does the Meta Pixel Work?Prerequisites Before Creating a PixelHow to Set Up Pixel on Facebook Ads Shopify: A Detailed Guide
- Step 1: Create Your PixelStep 2: Name Your PixelStep 3: Check for Partner IntegrationStep 4: Choose How You Connect Your WebsiteStep 5: Set Up Conversion APIHow to Add the Facebook Pixel to Shopify
- Option 1: Use Shopify's Facebook & Instagram AppOption 2: Manual Pixel Code Injection (Not recommended)How to Change Facebook Pixel on ShopifySummarize this post with AI
If you’re serious about growing your Shopify store through Facebook ads, setting up the Meta Pixel should be one of your first steps. It’s what enables you to track conversions, optimize ad delivery, and build more effective campaigns based on actual customer behavior.
In this guide, you’ll learn how to set up Pixel on Facebook ads Shopify, from creating the pixel and installing it to verifying that it’s working and using the data to build high-performing audiences. We’ll also cover key post-setup actions to help you make the most of every ad dollar. Let’s dive in!
What is Facebook Pixel? How does the Meta Pixel Work?
Before we talk about how it works, let’s explain what the Meta Pixel is. The Meta Pixel (formerly known as the Facebook Pixel) is a small piece of code for adding to your website. It helps you see what people do on your site after they click on your Facebook or Instagram ads. Here’s how the Meta Pixel works in simple steps:
- Tracks Visitors: Quietly keeps track of their actions, such as which pages they visit or which buttons they click.
- Collects Data: This information is sent back to your Meta (Facebook) account. It helps you understand what people like and what they do on your site.
- Improves Ads: With this data, you can target ads to individuals who are more likely to make a purchase from you. You can also remind people about your products if they visited your site but didn’t buy anything.
- Measures Results: The Meta Pixel tells you how well your ads are performing, so you can make informed decisions and drive more sales.
If you want to learn how to add Facebook Pixel to shopify, keep reading for the steps and tips you’ll need.
Prerequisites Before Creating a Pixel
Before you create a Meta Pixel for your Shopify store, make sure you have these things ready:
- A Facebook (Meta) Business Account
- Access to Meta Events Manager
- A Shopify Store
- Admin Access to add code or apps to your Shopify store.
It’s also helpful to have:
- A clear idea of what you want to track (like purchases, sign-ups, or page views).
- The latest version of Shopify, so you can easily add or update your pixel code.
It’s also a good idea to understand your store’s primary objectives. Do you want to track purchases, sign-ups, or something else? Knowing this will help you set up your Pixel correctly.
Once you have these things, you’ll be ready to set up your Pixel and start collecting helpful data for your ads!
How to Set Up Pixel on Facebook Ads Shopify: A Detailed Guide
Setting up the Meta Pixel for your Shopify store helps you track what your visitors do after clicking your Facebook or Instagram ads. Here’s a simple step-by-step guide anyone can follow.
Step 1: Create Your Pixel
- Log in to your Meta Business Suite.
- Go to Events Manager.
- Click “Connect data” and pick “Web” as your data source.
Step 2: Name Your Pixel
- After choosing “Web,” you’ll be asked to name your pixel.
- Pick a name that helps you remember which store or website it’s for.
A good name makes it easy to manage your pixels, especially if you have multiple stores.
Step 3: Check for Partner Integration
- Enter your website URL and click “Check.”
- Meta will tell you if Shopify supports automatic setup (it does!).
- If you see Shopify as a partner, you’ll be able to set up the pixel more easily.
Step 4: Choose How You Connect Your Website
- If Shopify shows up as a partner, select it.
- Meta recommends using both the “Conversions API” and “Meta Pixel” for the best results.
- Follow the prompts to connect your Shopify store.
Step 5: Set Up Conversion API
- Choose the easiest way to set up the Conversions API. Usually, this is through Shopify’s partner integration.
- Follow the instructions to complete the connection of your store.
Using both the pixel and the Conversion API helps you track more events, even if someone has ad blockers or cookies turned off.
Extra Tips:
- If you’ve added the pixel code to your theme before, ensure that you remove the old code. Having more than one pixel can cause Shopify’s Facebook pixel not to work or display incorrect data.
- After setup, verify that your pixel is functioning correctly in the Events Manager. If you see a message like Facebook pixel no activity yet, Shopify, don’t worry! Sometimes it takes a little while for data to show up after your first visitors.
Explore more:
- How to run Facebook Ads for Shopify
- How to Connect Google Analytics to Shopify?
- How to Set Up Facebook Shop with Shopify
How to Add the Facebook Pixel to Shopify
There are two primary methods for adding your Facebook (Meta) Pixel to your Shopify store. The first way is easy and recommended for most people. The second method is manual and should only be used if you are unable to use the app.
Option 1: Use Shopify’s Facebook & Instagram App
- Go to Shopify Admin > click on Apps > open Shopify App Store
- Search and install the Facebook & Instagram app by Meta
- Go through the app setup: Connect Facebook account, select Facebook Page, set data-sharing level
- Create Meta Pixel in-app, select data-sharing level (Standard, Enhanced, Maximum), and confirm
- The app will auto-install the Pixel — no manual code needed
Option 2: Manual Pixel Code Injection (Not recommended)
- Go to Events Manager and select your Pixel > Click “From a New Website”
- Choose “Install code manually” when asked how to connect your website
- Copy the Pixel base code from the “Install Base Code” step
- In Shopify, go to Online Store > Themes > … > Edit Code
- Open theme.liquid and paste the code right after the <head> tag, then save changes
Note: This method of how to add Facebook pixel to Shopify manually is not recommended because it can easily lead to mistakes if you’re not comfortable editing code. This method may cause issues like Shopify Facebook Pixel not working or collecting incorrect data.
Also, if Shopify or Facebook updates their systems, your manual code might break or stop working properly. Manually adding the Shopify Facebook Pixel code also increases the risk of having duplicate Pixels if you forget to remove old code, which can mess up your reports. Using the official app is much safer, automatic, and easier to manage.
How to Change Facebook Pixel on Shopify
Changing the Facebook Pixel on your Shopify store is simple if you follow these steps:
- Open your Shopify admin and go to Settings.
- Click on “Apps and sales channels” and select “Facebook & Instagram.”
- Click “Open sales channel” to access the Facebook & Instagram settings.
- Inside the app, go to Settings and find the Share data settings section.
- Here, you’ll see your current Pixel. Click “Change” to remove it.
This is also the process to follow if you’re looking for how to remove Facebook pixel from Shopify. You simply remove the existing Pixel, then either leave it disconnected or replace it with another one.
If you’re unsure how to disconnect Facebook pixel from Shopify without affecting your ads, this method ensures a clean removal through the official app. No manual edits required.
Note: If you manually added pixel code to your theme in the past, you’ll need to delete it first (in theme.liquid). Why? Because if both a manual code and a connected Pixel are active, your data might be duplicated or tracked incorrectly.
How to Check if Facebook Pixel is Working on Shopify
Ensuring your Facebook Pixel is functioning properly is crucial for accurately tracking your store’s visitors and sales. Here’s how you can check if your Pixel is set up and firing correctly on Shopify:
1. Use the Meta Pixel Helper Extension
- Download and install the Meta Pixel Helper (also called Pixel Helper for Meta) from the Chrome Web Store.
- After installing, open your Shopify store in Google Chrome.
- Click the Pixel Helper icon in your browser toolbar.
- The extension will show if your Pixel is found on the page, display your Pixel ID, and list any events (like PageView, AddToCart, or Purchase) that are firing.
- If you see a green checkmark next to events, your Pixel is working correctly. If there are errors or warnings, the extension will show details so you can fix them.

2. Check in Facebook Events Manager
- Log in to your Facebook (Meta) Business Suite and go to Events Manager.
- Select your Pixel from the list.
- Look for recent activity. If your Pixel is working, you’ll see events like PageView, AddToCart, and Purchase being recorded.

- If the status is “Active,” your Pixel is tracking data. But if it looks like Facebook Pixel not tracking purchases Shopify, try testing your checkout flow manually: add an item to the cart, complete a test purchase, and refresh Events Manager to see if the event fires.
3. Verify in Shopify Admin
- In your Shopify admin, go to Settings > Apps and sales channels.
- Click Facebook & Instagram and then Open sales channel.
- Go to Settings and check the Share data settings section. Here, you can see which Pixel is connected and confirm it matches your intended Pixel ID.
- You can also check Shopify’s analytics reports to see if conversion data is being tracked.
4. Troubleshooting Tips
- If the Pixel Helper or Events Manager shows errors, double-check that your Pixel ID matches the one in your Shopify settings.
- Make sure you haven’t added the Pixel code manually and through the app at the same time, as this can cause duplicate events or Shopify Facebook Pixel not working issues.
- Sometimes, it may take a few minutes for new Pixel activity to appear in Facebook Events Manager. If you see messages like Facebook Pixel no activity yet Shopify, wait a bit and try again.
So, Next Steps After Pixel Setup
Once your Facebook Pixel is installed on Shopify, there’s still more to do if you want to run smarter, more profitable ads. These next steps will help you get more accurate tracking, build better audiences, and recover lost sales.
1. Set Up Custom Events (e.g., Add to Cart, Purchase)
By default, your pixel tracks basic events, such as page views. However, to understand what actually leads to sales, you need to track specific actions, known as custom events.
These include:
- Add to Cart
- Initiate Checkout
- Purchase
If you’re using Shopify’s Facebook & Instagram by Meta app, standard events like Add to Cart and Purchase are tracked automatically. However, if you need to track something more specific, such as a click on a custom button, you’ll need to create a custom event manually.
You can view all your events in Facebook Events Manager, which helps you spot what’s working and what’s not.
2. Enable Conversions API (CAPI)
Browser-based tracking isn’t always reliable. Visitors might:
- Use ad blockers
- Decline cookies
- Have slow connections that prevent the pixel from firing
That’s why Facebook offers the Conversions API — a tool that sends event data directly from your Shopify server to Facebook.
Benefits of using CAPI:
- More accurate conversion tracking
- Fewer missed events due to browser issues
- Better optimization for your ads
To enable it, if you’re using the official Meta app on Shopify, go to the data sharing settings and select “Maximum”. Shopify will handle the setup behind the scenes. No code needed.
3. Create Custom Audiences Using Pixel Data
Once your pixel has collected some data, you can create Custom Audiences, including groups of people who’ve already interacted with your store.
Here’s what you can do:
- Target visitors who viewed a product but didn’t buy
- Re-engage shoppers who added items to their cart
- Segment past buyers for upsell or loyalty campaigns
How to set it up:
- Go to Facebook Ads Manager > Audiences > Create Audience > Custom Audience
- Choose Website as your source
- Select an event, audience retention (e.g., last 30 days)
- (Optional) Filter by specific URLs or exclude past buyers
- Click Create Audience
You can also build Lookalike Audiences to reach new people who behave like your existing customers.
4. Run Retargeting Ads on Facebook and Instagram
Retargeting ads are special ads that appear for individuals who have previously interacted with your website or social media. For example, if someone visits your store, looks at a product, or adds something to their cart but doesn’t buy, you can remind them about your products with retargeting ads.
To launch a retargeting campaign:
- Go to Ads Manager and create a new campaign
- Choose a conversion goal (e.g., Sales)
- Select placements across Facebook and Instagram
- Use your Custom Audience as the target
- (Optional) Use Dynamic Creative Ads to show the exact products each person viewed automatically
Tips to maximize your Facebook Pixel conversion on Shopify
Maximizing conversions with Facebook Pixel on Shopify can feel tricky, especially if you’re not quite sure where to start. Based on my previous experiences with this function, here are my 5 tips to maximize your Facebook Pixel conversion on Shopify, along with my real-world experiences:
- Use Custom Audiences for Targeted Ads: Leverage the data from your Facebook Pixel Shopify integration to create custom audiences, such as those who visited specific product pages or added items to their cart. By targeting these audiences, I saw a 25% increase in conversions because the ads were shown to people already interested in my products.
- Optimize for the Right Conversion Events: Ensure your Pixel tracks essential actions like purchases or sign-ups. When I configured my Pixel for “Purchase” events instead of generic traffic, it drastically improved the quality of leads and boosted my Shopify Facebook conversion tracking accuracy.
- Run Dynamic Product Ads: Set up dynamic product ads to show visitors the exact items they viewed but didn’t purchase. After implementing these ads, my Shopify store saw a 40% increase in the number of returning customers who completed their transactions.
- Test and Refine Ad Creatives: Use the insights from your Pixel data to test different ad images, headlines, and copy. This helped me identify which ad combinations resonated most with my audience, improving ad performance by nearly 30%.
- Combine Pixel Data with Lookalike Audiences: By creating Lookalike Audiences based on Pixel data, I reached new customers with profiles similar to those of my existing buyers. This strategy brought in a 15% increase in conversions as it tapped into a highly relevant audience for my Shopify store.
FAQs:
How to create a Facebook pixel for Shopify?
Go to your Meta Business Suite > Events Manager. Click “Connect data” > choose “Web” > then click “Create Pixel.” You can connect it to your Shopify store using the Facebook & Instagram app from the Shopify App Store.
How do I create my Facebook pixel?
Log in to your Meta Business Suite. Go to Events Manager, click Connect data, choose Web, then follow the steps to create and name your Pixel. You’ll get a Pixel ID that can be used on your website.
How to create Facebook ads for your Shopify store?
Go to “Meta Ads Manager” > click “Create,” then choose an ad objective like Traffic or Sales. Connect your Pixel, choose your audience, add your product link, image, and text, then publish the ad. Make sure your Pixel is active to track results.
How to get pixel code from Facebook?
In Events Manager, click on your Pixel. Choose Set up > Install code manually. Copy the Pixel base code shown, which you can paste into your website if you’re not using the Shopify app.
Final Thoughts
I hope you find this post helpful if you’re figuring out how to set up Pixel on Facebook Ads Shopify. The setup might seem technical at first, but it’s straightforward once you follow the steps.
Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Vietnam. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.Related Post
























