Meta Pixel, what it offers your website or eshop and how it is used

The Meta Pixel is a small piece of JavaScript that goes on your site and records what visitors do, for example which product they viewed, what they added to the cart and whether they completed a purchase. With this data Meta measures which of your ads on Facebook and Instagram bring sales, shows your ads to people who are more likely to buy and lets you reach again the people who visited your site. It is usually added with a plugin or with Google Tag Manager and, in the European Union, it must load only after the visitor consents to cookies.

What is the Meta Pixel and what does it record

The Meta Pixel is the old Facebook Pixel under a new name. In Meta's tools it belongs to a dataset, where the events from your site are collected.

The Pixel has two parts:

  • Base code. It goes on every page of the site, between <head> and </head>. It loads Meta's library and automatically sends a PageView event on every page view.
  • Event code. Short fbq('track', ...) commands that send specific actions, such as adding to cart or a purchase.

Every time it loads, the Pixel sends Meta data such as the browser's HTTP headers, the Pixel ID and a Meta cookie, button clicks, values you define, such as the order amount, and form field names.

What the Meta Pixel measures, the events

Meta has ready-made standard events for common actions. For an eshop the most useful are:

Event When it is sent
PageView On every page view, automatically
ViewContent The visitor views a product page
Search The visitor runs a search
AddToCart A product is added to the cart
InitiateCheckout Checkout starts
AddPaymentInfo Payment details are filled in
Purchase The purchase is completed, with value and currency

For a site without a cart, Lead for a submitted form, Contact for getting in touch and CompleteRegistration for a sign-up matter more. You can also define your own custom events or conversions based on a page address, such as a "thank you" page.

Purchase always needs a value (value) and a currency (currency). Without them Meta cannot calculate how much each ad brought in.

What it gives you in practice

  • Conversion measurement. In Ads Manager you see how many purchases, forms or sign-ups each campaign brought and how much each result cost.
  • Ad optimization. When a campaign's goal is purchases, Meta uses the events to show the ad to people who resemble those who have already bought.
  • Remarketing on Facebook and Instagram. With Custom Audiences you build audiences from your site's visitors. For example, people who viewed a product or put something in the cart without buying. You can also exclude people who have already bought.
  • Similar audiences. Based on your customers, Meta finds new people with similar characteristics (Lookalike).
  • Catalog ads. In an eshop with a synced product catalog, Meta shows each visitor the products they viewed. For this, the events must also send the product ID.

Conversions API, why Meta recommends it alongside the Pixel

The Pixel runs in the visitor's browser. Ad blockers, browser privacy settings and refused cookies can block it, so some events never reach Meta.

The Conversions API sends the same events from the site's server directly to Meta. Meta recommends using both together for better ad performance. In that case the same event can arrive twice, once from the browser and once from the server. To avoid double counting, each event must have the same name and the same ID (event_id) in both sends. Meta keeps the first and discards the second if it arrives within 48 hours.

For those who already have a Pixel, Meta offers a no-code Conversions API setup from Events Manager. Many eshop plugins also have a relevant option.

How to add the Meta Pixel to a site or eshop

There are three common ways. Choose one. If you add the Pixel in two ways at once, for example with a plugin and with Google Tag Manager, every event is counted twice.

With a plugin. For the Meta Pixel in WooCommerce there is the official Meta for WooCommerce plugin. It connects the store to your Meta account, adds the Pixel and syncs the product catalog. The plugin sends the eshop events by itself, without code of your own.

Meta Pixel with Google Tag Manager. Google Tag Manager is a "container" for all the site's tags, such as Google Analytics, the Meta Pixel and Google Ads. It goes on the site once, and from there you add or change tags without touching the site's code. You define when each event is sent, for example on the "Add to cart" button or on the order confirmation page. The same actions can be sent to Google Analytics at the same time. Tag Manager also has consent settings, so each tag loads only when the visitor allows it.

Manually in the code. The base code goes in the theme's <head> and the events where they are needed. If you change theme files, do it in a WordPress child theme, otherwise the code is lost on the next update.

Pixel ID or the full code?

The Pixel ID is a long number that identifies your Pixel. Plugins and Google Tag Manager templates usually ask only for this. For manual placement you need the full base code, a script of several lines containing the fbq('init', ...) command with your ID. If your developer asks for "the Pixel code", ask how they will install it, so you give them the right thing.

The Meta Pixel uses cookies for advertising. In the European Union such cookies are allowed only after the visitor has first given consent. That is why the site needs a banner or consent management platform that loads the Pixel only after "Accept".

Meta provides two commands for this. fbq('consent', 'revoke') goes before fbq('init', ...) on every page and keeps the Pixel on hold. fbq('consent', 'grant') is called when the visitor accepts, and then the Pixel starts sending. If you use Google Tag Manager or a consent plugin, this is done from their settings.

Two more rules:

  • Mention the Meta Pixel and its cookies in the site's Privacy Policy and Cookie Policy.
  • Don't send Meta sensitive or personal data, such as health information, financial details, names or emails inside page addresses and event parameters. Meta's terms prohibit it and the law restricts it.

How do I check that the Meta Pixel works correctly

  • Use the test events tool in Meta's Events Manager. Browse through the site and see which events arrive.
  • Install the Meta Pixel Helper extension in Chrome, which shows whether the Pixel loads on each page and which events it sends.
  • Place a test order and check that Purchase is sent once, with the correct amount and currency.
  • After every change, clear the site cache so visitors get the new version. See how to clear the cache. If the cache's JavaScript optimization settings change the order of scripts, check again that the Pixel loads.

Frequently Asked Questions

I only sent my developer the Pixel number, is that enough?
It is enough if they will add it with a plugin or with Google Tag Manager. For manual placement the full base code with fbq('init', ...) is needed.

Does the Meta Pixel slow down my site?
A little, because it loads a script from Meta's servers. The problem grows when many pixels, chats and widgets pile up. Google Tag Manager helps keep them organized in one place. See what makes a WordPress site slow.

Why does Meta count fewer sales than I see in the eshop?
Some visitors refuse cookies or use an ad blocker, so the Pixel sends nothing. The Conversions API covers some of these cases, as long as the visitor's consent choice is respected.

Why is every purchase counted twice?
Usually the Pixel has been added in two ways, for example both by a plugin and by Google Tag Manager. Another cause is Pixel and Conversions API without a shared event_id. Keep one installation method and set up deduplication.

Do I also need Google Analytics if I have the Meta Pixel?
They are different tools. The Pixel measures for Meta's ads. Google Analytics shows all the site's traffic, from every source. With Google Tag Manager you send the same events to both.

Can Konet add the Meta Pixel to my site?
Hosting support does not cover changes to the site's code or plugin settings, see what hosting support covers. Such work is done only as an exception, after it has been agreed with you. To discuss it, open a ticket from the Client Area.

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups: 24 every 2 hours for 48 hours, then 6 daily, 4 weekly and 3 monthly.