Cover image for How to Add Facebook Pixel to Liferay [Easy Guide]

How to Add Facebook Pixel to Liferay [Easy Guide]

wasim117 profile image Wasim Shaikh ・2 min read

You can easily install Facebook’s remarketing/retargeting pixel in Liferay.

In this article, we will show you how to install Facebook remarketing/retargeting pixel in Liferay.

What is Facebook Pixel?

When you visit a website, you start seeing their ads on Facebook? This is called retargeting.

Its like Google Analytics code which give information about user location, device information and in Facebook case its provides detailed information about user behaviour.

This allows Facebook to retarget users visiting your website on Facebook.

Step 1: Get Facebook Pixel Code

Assuming you already have the Facebook Ad account and you have the Pixel code.

You can follow official guide for Facebook Pixel

  s.parentNode.insertBefore(t,s)}(window, document,'script',
  fbq('init', 'XXXXXX');
  fbq('track', 'PageView');
<noscript><img height="1" width="1" style="display:none"

Step 2: Add Facebook Pixel code using Theme

If you want only basic integration of the Facebook remarketing and code available on every pages of Liferay instance you can add Pixel code in theme.

In your theme edit theme template.


Add pixel code before closing of the head tag.

Once theme is updated and deployed, Facebook Pixel will be available on all the pages.

Note: If you change the theme or use custom theme for some public pages. Facebook Pixel will not fire on that Liferay page.

Posted on by:

wasim117 profile

Wasim Shaikh


Front End Developer, Digital Marketer


Editor guide