Knowledge Base » Blog » Social Media

Facebook Pixel - what is it and why should it be implemented on your site?

Updated on: 2020-05-22  
(9 min. read)
Facebook pixel
You run company social media channels, but despite your efforts you are still not satisfied with the results? Thanks to the information contained in this article you will be able to optimize the costs incurred for advertising campaigns and operate in a group of potential customers - both new and returning ones.

Table of Contents

Facebook Pixel – what is it?

Facebook Pixel is actually a snippet of code that is posted on your website. After its implementation, you will gain access to advanced and effective tools that monitor specific behaviours and collect data and analyse them. Thus, the Facebook pixel not only optimizes the costs of the campaign but also streamlines management and allows users to get such value from advertising that you assumed at the stage of developing the strategy.

But Pixel itself primarily offers high conversion, i.e. the implementation of the planned goal that has not been satisfactorily achieved so far. It streamlines processes and a better understanding of your target group. Thanks to Pixel, you can find out which of the subpages on your website sell on Facebook - a conversion or somehow an event specified in such a campaign can consist of purchase, subscription to a newsletter, or transition to a trial period.

Although Facebook Pixel is a small piece of JavaScript code that is placed in the source code of a website, its functionality is worth placing high in your optimization intentions.

Did you know that...


The most important element of Pixel is its ID number, which provide information about website users (who visited a website, what they browsed it and how long). All data is processed by Facebook itself, so you don't have to worry about collecting it.

Remember that Facebook Pixel optimizes your campaign, but above all it collects various behavioural information about users. Pixel itself learns during such conversion analyzes, and thus better manages its clients' budget in the future. For website owners it will be a valuable tool that collects a lot of information in one place, better specifies the target group and allows you to effectively optimize the use of advertising budgets.

Why use Facebook Pixel?

The correct implementation of Pixel provides a number of possibilities. First of all, it involves ad targeting based on the data that users leave on your website, although it is also worth mentioning the possibility of optimizing the campaign settled for an achieved goal, e.g. conversion. In the latter case, although it seems that you pay only when someone actually makes a purchase or performs another activity assumed in the campaign, in practice Facebook charges fees even though sometimes a specific goal is not met. These are small amounts, but they still occur.

Campaigns organized using the Facebook Pixel enable building a more precise mailing database, a tailored target group, which in the future will consist of loyal and returning customers. It is worth remembering that through Pixel, you get not only to new customers, but above all to those who have already visited your site, but perhaps they did not carry out the action you would expect.

This tool, which is very simplified, aims to make the best use of the available advertising budget to first select the right target group, and then direct the campaign to it, which will ensure a higher number of conversions than before.

Advertising on Facebook can be divided into two "periods": the one before installing Pixel and the one after its implementation. It is hard to imagine effective activities in the e-commerce industry without combining information collected on Facebook customers with those they leave on your website. Data collected with the help of Pixel allow you to create new groups of recipients (Custom Audience) based on information from your website and Facebook. Due to the above, you can target advertising to people who have visited a specific category of products in the last 7 days, etc. The only thing that limits you is your ideas on how to use the available data.


Izabela Norek, social media specialist at

Facebook Pixel allows you to optimally use the functionality of retargeting campaigns. Re-reaching customers who have already visited your site is much more precise, and above all - possible from Facebook, and previously it could only be done in Google AdWords. Now, it is easier to define the purpose of such campaigns and the benefits you will get.

Facebook Pixel features at a glance:

  • tracking conversions on the website coming directly from advertising campaigns on Facebook,
  • creating remarketing campaigns - creating a database of customers who visited your website,
  • event tracking - researching specific behaviours on the website, including purchase, registration, adding products to the basket, going to the contact section, searching for products, etc.,
  • creating Custom Audiences based on data obtained from a website.

It is also worth mentioning here that Pixel effectively encourages users to return to the site and finish shopping, gathers a group of people with similar interests, but above all supports the achievement of goals tailored to specific stages of the sales funnel.

Types of Facebook Pixel

Facebook Pixel has several varieties that we call standard events. Each of them allows you to measure the specific behaviour of users visiting the website. In practice, such events differ by one line of code and provide information about completely different actions. For example, conversions, i.e. downloading a file, saving, purchasing, or adding a product to cart.

Site activity


Standard event code

Adding payment details

Adding information about customer payments during the checkout, e.g. Clicking "save billing information" button.


Add to cart

Adding a product to the cart, e.g. Clicking the "Add to cart" button on the website.

fbq('track', 'AddToCart');

Add to wish list

Adding products to the wish list, e.g. Clicking the "Add to cart" button on the website.

fbq('track', 'AddToWishlist')

Completion of registration

Sending information by the customer in exchange for a service provided by the company, e.g. e-mail subscription.

fbq('track', 'CompleteRegistration');


Telephone or SMS, email, chat or other type of customer contact with the company.

fbq('track', 'Contact');


It is worth implementing various events, because then you know how many times specific actions have been performed as part of a particular advertisement. But this is also an important action for Facebook itself, which can thus optimize its ads and analyse users in an even better way.

Importantly, when analysing the collected data, you can combine individual events and create more campaigns on this basis. A good example here will be a campaign that you have probably seen many times yourself. A message such as: "Hi, you did not finish shopping in our store - finish it and get a 10% discount."

Most often, two events are used here: adding a product to the cart and not going to page to complete the purchase process. Pixel saw that someone added a product and this ended the operation. It will return to such a person and maybe gain a loyal customer for you.

How to implement Facebook Pixel on the site?

Any experienced social ninja should handle the installation. It involves a fairly intuitive pattern of activities. Start by entering the Event Manager on Facebook and moving to the "Pixels" tab.

Then click "Get Started".

You can now install the code on your site with three options to choose from. Actually, you will receive detailed instructions for each of them, so you should choose the optimum one and handle it without any problems.

After going through the subsequent installation stages, you will obtain the JS code for direct implementation on the website. The code should be implemented between the <head> and </head> tags, as close as possible to the closing tag. Keep in mind that there may be other codes there, e.g. Google Analytics - in this case, put the pixel code just above </head>.

In WordPress, it is a bit easier because the whole Facebook Pixel implementation process can be carried out by installing one of the suggested plugins, e.g. Tracking Code Manager, then simply copy the code directly to the plugin. Another well-known plugin is Pixel Your Site, which you just need to install on the site and paste the pixel ID code into it.


How do you make sure that the Facebook Pixel code is installed correctly? Go to your Ad Manager account and wait for verification. Activation usually occurs automatically. A working code should generate a chart similar to the one below.


How to create a group of recipients using a Facebook Pixel?

To start with, we need to find the "Audience Groups" tab. Click "Custom Audiences", then "Website Traffic" and "All Visitors to Your Site."

Then select the page that interests you from the drop-down list, and narrow the period of data collection. Approve the action through the "Create an audience" option.

One of the most interesting features provided by creating audience groups is the ability to upload to Facebook a database with customer data and create on its basis a group in which your customers are located. Then, based on this information, you can create campaigns and audiences similar to our customers, or improve the effects of campaigns charged for conversions. Choose "File with customer data" and through the "Add customers from your own file" upload the database.

For example, you can upload the mailing database from your newsletter (as long as you have the marketing consent in accordance with the GDPR!), and Facebook will connect email addresses with personal accounts. Thanks to this, you can send a personalized message to people who ordered your newsletter.

Adding Pixel and creating appropriate audience groups with a division into e.g. users visiting a given category or blog subpages will allow paid advertising to be directed to them at a later stage of work. Each group must gather a minimum of 1,000 people - that's why it's so important to remember to install Pixel and create groups before planning to launch a Facebook Ads campaign. The collected database will allow you to reach a specific group of recipients - for example, those who visited subpages related to men's fashion, but ultimately did not make a purchase.


Wojciech Kamiński, SEO specialist at Netim

Creating ads using Facebook Pixel is similar to the campaigns you have created so far. The difference is that you need to choose a goal that will be billed based on this particular campaign.

And how useful is Facebook Pixel in your work? Share your experiences!

Your comments (0)
The WhitePress® team reserves the right to remove comments which do not comply with the Terms and Conditions for publishing comments or which contravene the law and good manners.

The Controller of personal data of individuals using the website and all its subpages (hereinafter: the Service) within the meaning of Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (hereinafter: GDPR) is collectively "WhitePress" Spółka z ograniczoną odpowiedzialnością with its registered office in Bielsko-Biała at ul. Legionów 26/28, entered into the Register of Entrepreneurs of the National Court Register kept by the District Court in Bielsko-Biała, 8th Economic Division of the National Court Register under the KRS number: 0000651339, NIP: 9372667797, REGON: 243400145 and the other companies from the WhitePress Group (hereinafter together: the Controller).

By registering for the newsletter, you consent to receiving commercial information via electronic communication means, especially email, regarding direct marketing of services and products offered by WhitePress Sp. z o.o. and its trusted business partners interested in marketing their own goods or services. The legal basis for processing your personal data is given consent (Art. 6 (1) (a) GDPR).

At any time, you have the right to withdraw your consent for the processing of your personal data for marketing purposes. For more information on the processing and legal basis for processing your personal data by WhitePress Sp. z o.o., including your rights, you can find in our Privacy Policy.

Read all
No comments on this article yet.

Recommended articles