How to Add the Facebook Pixel Base Code to Your Joomla! Website

Insert the Facebook Pixel on Your Joomla Website

A lot of marketers haven’t added the Facebook pixel base code to their Joomla! website yet due to the assumption that the process would be complicated or overly technical. In this blog post I will show you that it’s not.

What is the Facebook pixel and why do you need to add it to your website?

The Facebook pixel allows you to:

  • create powerful audiences for ad targeting
  • run dynamic ads
  • track conversions
  • optimize for conversions

Let’s get started with locating your Facebook pixel

1. Login to business.facebook.com

2. Choose the Facebook Ads Account that will be connected to your Pixel.

3. Choose menu option "Pixel" in the top left menu.

Business Manager

  1. If you haven’t created your pixel yet you will come to the guide on how to create and “Set up your Facebook Pixel”.

Facebook Pixels

  1. If you have created your pixel you can get access to the pixel by clicking on the button at the top [Set Up Pixel].

Find your pixel code

4. Click on to the option “Copy and Paste the Code”.

Install your pixel code

5. Copy the Pixel Base Code. 

install base pixel code

Insert the Facebook pixel on your website

Your code needs to be injected before the closing <head> tag in your Joomla! template. On every single page. There are several ways of injecting it:

Insert it in you template configurations 

Pro:

  • Easy & fast if you have a template where there is a field to insert your code.

Con:

  • It might be difficult to know where in the template it will be inserted. And this code needs to be injected before the closing <head> tag.
  • It is inserted on all web pages. If you would like to use different pixels for different parts of the website (for example if you have one Facebook Ad account for each language or market segments) then you need to copy the template to each and every single language or market segment.
  • If you have visitors from the EU this way is not compliant with the EU law that prohibits you from placing cookies on a device before the visitor has left his/her consent.

You can insert it in your core files of your template

Pro:

  • No need to find (a better solution, or) an extension.

Con:

  • It is inserted on all web pages. If you would like to use different pixels for different parts of the website (for example if you have one Facebook Ad account for each language or market segments) then you need to copy the template to each and every single language or market segment.
  • If you have visitors from the EU this way is not compliant with the EU law that prohibits you from placing cookies on a device before the visitor has left his/her consent.
  • If you have a template with an update service you stand a chance that your code will be overwritten by the update. And you have to manually make sure that it is still there or you need to insert it again.

Install an extension and insert your pixel (you can find several options at extensions.joomla.org)

Pro:

  • This solution may be more update safe and may offer more options of where to place the pixel.

Con: 

  • If it is a commercial extension you need to invest your money in it.
  • If you have visitors from the EU this way is not compliant with the EU law that prohibits you from placing cookies on a device before the visitor has left his/her consent.

Use our extension bundle including PixTracker, PixAnalytics and PixCookie Restrict

Pro:

  • If you have visitors from the EU this is compliant with the EU law that prohibits you from placing cookies on a device before the visitor has left his/her consent.

Con:

  • You can do so much with this, you won't know where to start ;)
  • It's a commercial extension so you need to invest your money in it.

Next step

Now when you have the Facebook Pixel installed the next step is to create Facebook Event Pixels. Read our blog about "How to Add the Facebook Pixel Event Code to Your Joomla! Website"

We will soon release a blog post on how you create Facebook Audiences in business.facebook.com. Keep your eyes open for it.

  • Sarah Watz

    Sarah Watz

    Since the mid-90s, Sarah has worked with sales and digital marketing and in 2003 she started the digital agency Pixpro. She is a well sought-after speaker and is a devoted member of both the Joomla! and the Infusionsoft community.