1. Documentation
  2. How to
  3. Install Meta Pixel

Install Meta Pixel

Adding Meta Pixel to your WordPress site helps you track user interactions and optimize your Facebook ads. Here’s a straightforward guide to achieving this without any hassle:

Method 1: Using a plugin

PixelYourSite is a freemium plugin that makes it easy to add and configure Meta Pixel and other tracking platforms like Google Analytics and Pinterest Tag.

Install the plugin:

  1. Go to your site admin area.
  2. Navigate to Plugins -> Add New.
  3. Search for “Pixelyoursite“.
  4. Install and activate the plugin.

Configure the plugin:

  1. In the left menu, click on PixelYourSite.
  2. Locate the Meta Pixel row and push the Click for settings button.

Method 2: Adding code via theme’s functions.php

This method requires having the child theme installed and activated – learn how to install the child theme. Using a child theme’s functions.php file allows you to add Meta Pixel code without directly modifying the theme. Here’s how to do it for our themes:

  1. Go to your site admin area.
  2. Navigate to Appearance > Theme File Editor.
  3. Ensure that your active child theme is selected from the dropdown in the upper-right corner.
  4. On the right side, find and click on Theme Functions (functions.php).
  5. Scroll to the bottom of the functions.php file and add the following code snippet:
function add_meta_pixel_code() {
    <!-- Meta Pixel Code -->
      fbq('init', 'YOUR_PIXEL_ID');
      fbq('track', 'PageView');
    <noscript><img height="1" width="1" style="display:none"
    <!-- End Meta Pixel Code -->
add_action('keydesign_head_bottom', 'add_meta_pixel_code');

Important: replace YOUR_PIXEL_ID with your actual Facebook Pixel ID.

Following these steps ensures your WordPress site is integrated with Meta Pixel, allowing you to track user actions and enhance your advertising efforts effectively.

Was this article helpful?