Meta Pixel: How to Install and Set It Up Step by Step

The Meta pixel is the foundation of every campaign on Facebook and Instagram. Without it, the algorithm does not know who purchased, who added a product to the cart, and who only viewed the page and left. As a result, it optimizes campaigns for clicks instead of sales, and you pay for traffic that does not convert. In this guide, we show you how to install the Meta pixel step by step, which events to configure in an online store, and how to verify that your data is accurate.

What is the Meta Pixel and How Does It Work

The Meta pixel is a snippet of JavaScript code that you place on your website. When a user takes a specific action, such as viewing a product or completing an order, the pixel sends information about this event to Meta. Meta links it to the user's Facebook or Instagram account and uses it in three areas.

• Measurement. You see in Ads Manager how many purchases, leads, and what sales value each campaign, ad set, and individual ad generated.

• Optimization. The algorithm learns what kind of people buy and shows ads to people with a similar profile. This is why the "Sales" objective works better than the "Traffic" objective.

• Target Audiences. Based on events, you create custom audiences, such as people who added a product to their cart in the last 7 days, and target them with remarketing.

In Events Manager, the pixel now functions as part of a dataset. A dataset combines signals from the browser and the server, so you shouldn't treat the pixel as the sole data source, but rather as the first piece of the puzzle.

How to Install the Meta Pixel: 3 Methods

1. Store Platform Integration

The simplest path for most stores. Shopify, WooCommerce, Shoper, IdoSell, and PrestaShop have official or partner integrations with Meta. In Events Manager, you select "Connect data sources," then "Web," and choose your platform. The integration installs the pixel and standard e-commerce events, and in many cases instantly enables the Conversions API as well. We choose this solution by default because it minimizes the risk of code errors.

2. Google Tag Manager

If your store is custom-built or you want full control over when and with what parameters each event fires, use Google Tag Manager. You insert the pixel's base code as a tag on all pages, and configure events with separate tags triggered by the data layer (dataLayer). Requirement: the developer must correctly push the cart value, currency, and product IDs to the dataLayer. Without this, events will fire, but without the data needed to calculate ROAS.

3. Manual Code Installation

You copy the base code from Events Manager and paste it into the head section of every page, and add events directly into the code of the appropriate templates. This is an option for teams with an in-house IT department. In practice, it is the most prone to errors during template updates, so it requires regular monitoring.

Which Events to Configure in an Online Store

The base code alone only tracks page views (PageView). To optimize sales, you need standard events that reflect the customer journey.

• ViewContent on the product page, with content_ids, content_type, value, and currency parameters.

• AddToCart after adding a product to the cart, with the value and product ID.

• InitiateCheckout upon entering the checkout process.

• AddPaymentInfo after selecting a payment method, useful for diagnosing drop-offs.

• Purchase on the thank-you page, with the actual order value (always calculated consistently, net or gross), PLN currency, and order ID.

For service and B2B companies, key events will include Lead, Contact, or CompleteRegistration. The golden rule is: the event should only fire after the form is actually submitted, not upon clicking the button.

Product IDs in events must be identical to the IDs in your product catalog. If the pixel sends an SKU while the catalog uses an ID from the store's database, dynamic ads will not match products, and catalog remarketing will stop working.

Domain Verification and Event Priorities

After installation, verify your domain in Business Manager (Business Settings, Brand Safety section, Domains). The fastest way is via a TXT record in your DNS. Verification confirms that you control the domain and have the authority to configure events for that website.

It is also worth managing event priority in Events Manager, especially if a large share of your traffic comes from Apple devices with restricted tracking. Purchase should have the highest priority, while upper-funnel events should have lower priority.

The Pixel Alone Isn't Enough: Add the Conversions API

Ad blockers, browser restrictions, and cookie consent policies cause the browser pixel to lose some events. In stores we audit, the discrepancy between orders in the store admin and purchases reported solely by the pixel often reaches 10–20%, and it can be even higher with a large share of iOS traffic. That is why we always combine the pixel with the Meta Conversions API, sending events directly from the server.

When running both sources in parallel, deduplication is critical. Every event sent from the browser and the server must share the exact same event_name and event_id. Without this, Meta will count one purchase twice, and your reported ROAS will be inflated.

Also remember cookie consent. In Poland and throughout the EU, the pixel should only fire after obtaining marketing consent from the user. A properly configured consent banner and Consent Mode in Google Tag Manager are mandatory today, not optional.

How to Check if the Pixel Is Working Correctly

• Meta Pixel Helper. A Chrome extension that shows which events fire on a given page and with which parameters.

• Event Testing. In Events Manager, under the Test Events tab, you enter your website URL and navigate through the purchase path. You can see events from both the browser and the server in real time.

• Event Match Quality (EMQ). A score from 0 to 10 showing how effectively Meta matches events to user accounts. Aim for a score of 7-8 or higher for Purchase events. You can improve it by passing hashed email, phone number, external ID, and the fbp and fbc parameters.

• Comparison with Store Dashboard. Once a week, compare the number and value of purchases in Events Manager with your store's backend data. A discrepancy greater than 20% indicates that something is wrong.

Most Common Pixel Configuration Errors

• The Purchase event fires every time the thank-you page is refreshed, inflating sales numbers.

• The order value is passed as text with "zł" added or using a comma instead of a decimal point.

• Two different pixels are running on the website, such as an old one from a previous agency and a new one from an integration.

• Missing currency parameter in events, preventing Meta from calculating conversion value.

• The pixel does not fire after payment through a third-party gateway because the user does not return to the store's thank-you page.

Each of these errors quietly sabotages optimization. The campaign continues to run, but the algorithm learns from flawed data. That is why before scaling budgets in Advantage+ Sales campaigns, we always start with a measurement audit. This is complemented by proper link tagging with UTM parameters, allowing you to cross-reference Meta data with Google Analytics.

Summary

A properly installed Meta pixel with a full set of e-commerce events, a verified domain, and a concurrently running Conversions API is essential for Facebook and Instagram campaigns to optimize for sales at all. Measurement comes first, budget second. If you are unsure whether your data is complete, the AdVibes Meta Ads team will conduct a pixel and CAPI audit, and then fix your configuration. Contact us, and we will get back to you with an actionable diagnosis.

Find your next growth opportunity.

92% of clients stay with us long term

Talk to the team who will work on your business.

Find your next growth opportunity.

92% of clients stay with us long term

Talk to the team who will work on your business.