Facebook Pixel (Meta Pixel): how to install and test it

A step-by-step guide to installing Meta Pixel: setup in Events Manager, three installation methods, standard events, Conversions API and troubleshooting.

38Views

Facebook Pixel (Meta Pixel): how to install and test it

Facebook Pixel (officially Meta Pixel) is a piece of JavaScript code on a website that tells Meta what visitors do: open pages, add products to their cart, submit requests and pay for orders. To install it, create a pixel in Events Manager, insert the base code into the <head> section of every page (manually, through a platform integration or through Google Tag Manager), configure events and test them in Events Manager and Meta's browser extension. Below is a step-by-step guide with examples and common mistakes.

Why your business needs a pixel

Without a pixel, Facebook and Instagram advertising runs blind: the ad account records clicks but does not know which visitors made a purchase. The pixel provides four capabilities:

  • Conversion tracking. Reports show the cost per lead or purchase alongside the cost per click.
  • Optimization. A campaign with the Sales or Leads objective looks for people similar to those who have already made a purchase or submitted a request.
  • Retargeting. You can show ads to people who viewed a product but did not place an order, or those who visited a service page within the past 30 days.
  • Lookalike audiences. Meta uses customer data to find new people with similar behavior.

Install the pixel before launching your ads rather than afterward. It only collects data once installed, and retargeting audiences also start building from that date.

How to create a pixel

You create a pixel in Events Manager, Meta's tool for managing data sources. It is best to do this within your company's business portfolio so the business owns the pixel rather than an employee or contractor.

  1. Open Events Manager and add a new data source for your website.
  2. Give the pixel a clear name, such as your website name, and enter the website address.
  3. Choose an installation method: manual setup or partner integration.
  4. Connect the pixel to the ad account you will use to run your ads.

One pixel is usually enough for a website. If you create several pixels and install them inconsistently, your data will become fragmented and campaign optimization will be less effective.

If a contractor previously created the pixel in their own account, ask them to transfer it to your business portfolio or grant you full access. Otherwise, switching contractors could leave you without your event history and retargeting audiences.

Three ways to install Facebook Pixel on your website

Manual installation

Copy the base code from Events Manager and insert it on every page of your website. Meta recommends placing it between the opening and closing <head> tags. This reduces the chance of browsers or third-party scripts blocking its execution. The pixel ID appears twice in the code, and the fbq('track', 'PageView') line records each page view. Leave this line unchanged.

Through a platform integration

Many website builders and CMS platforms let you connect a pixel using its ID or an official Meta integration. This is the quickest option, but check which events the platform sends automatically. Some only track page views, not purchases.

Through Google Tag Manager

If your website already uses Tag Manager, you can add the pixel as a Custom HTML tag. You can then configure events without editing the website code and manage all your Google Analytics, Google Ads and Meta tags in one place.

Which events to configure

The pixel tracks page views automatically. Other actions must be sent as separate events. Meta provides a set of standard events. Use these rather than creating your own event names:

  • ViewContent: viewing a product or service page;
  • AddToCart: adding a product to the cart;
  • InitiateCheckout: starting the checkout process;
  • Purchase: completing a purchase, including the purchase value and currency;
  • Lead: submitting a lead form;
  • Contact: clicking a phone number, messaging app link or email address.

Example of a purchase event: fbq('track', 'Purchase', {value: 1250, currency: 'UAH'}). The code should fire on the "Thank you for your order" page only after an actual payment or order placement, not every time the page is refreshed.

If you cannot edit the website code, you can define some events using custom conversions in Events Manager. For example, you can count every visit to the /thank-you/ page as a lead.

Conversions API: why send the same data from your server?

The pixel runs in the visitor's browser, so some events are lost because of ad blockers and browser privacy settings. Conversions API sends the same events directly from your website server to Meta. Using the pixel alongside Conversions API provides more complete data. To prevent the same purchase from being counted twice, both channels send the same event name and event ID.

A pixel alone is enough for a landing page that generates a couple of leads per week. For an online store running regular advertising campaigns, sending events from the server noticeably improves reporting accuracy.

How to check whether Facebook Pixel is working

  1. Open your website and visit several pages. A PageView event should appear in Events Manager within a few minutes. If it does not appear, wait and refresh the page.
  2. Use the Test Events tool in Events Manager. Perform actions on your website and see which events Meta receives in real time.
  3. Install the free Meta Ads Data Advisor extension for Chrome or Edge (formerly called Meta Pixel Helper). An icon displaying a number indicates that a pixel has been detected on the page. Disable your ad blocker, open the extension's side panel, add a product to your cart and check that the event is marked as successful.

The most common problems during testing are duplicate pixel installations (manually and through a plugin), an incorrect pixel ID, purchase events firing when a page loads without an order, and missing purchase values or currencies in Purchase events. Another frequently overlooked step is domain verification in the business portfolio.

If your customers include EU residents, follow cookie consent requirements. In this case, the pixel should only fire after the visitor gives consent.

How WID7 can help

We install Meta Pixel and Conversions API, configure events for your website and check that data is received without duplicates. This is included in our Facebook and Instagram advertising setup service: one-time setup from UAH 5,000, setup and ongoing management from UAH 5,000/month, with a separate advertising budget.

If your ads are already running but the figures in your ad account do not match your sales, start with an advertising audit (from UAH 3,000). We will check your pixel, events and attribution. For underlying problems, such as slow-loading pages or forms that lose leads, a website audit is available from UAH 3,500.

Rate this article

Other articles

loading