How to Manually Set Up the Meta Pixel on Your WordPress Site
Installing the Meta Pixel (formerly known as the Facebook Pixel) is a critical step if you’re planning to run Meta (Facebook and Instagram) ads. It lets you track site visitors, measure ad performance, and retarget users who interact with your site.
In this post, we’ll walk you through how to set up the Meta Pixel manually using a code snippet in WordPress. This gives you full control and ensures reliable tracking if you’re not using a partner integration like Shopify or Wix.
Step 1: Create a Meta Pixel in Business Settings
Start by navigating to your Meta Business Settings.
- Click the gear icon in the lower left.
- From the sidebar, open Data Sources > Data Sets and Pixels.
- Click the blue Add button in the top right.
- Give your pixel a name (e.g., “My Testing Pixel”) and save.
You’ve now created your Meta Pixel. Next, it’s time to connect it to your website.
Step 2: Choose Manual Setup
Meta offers two options for installation:
- Partner Integration: A simplified option for platforms like Shopify and Wix.
- Manual Installation: Best for WordPress users who want more control.
For this tutorial, we’re going the manual route.
- Click Set Up Pixel > Install Code Manually.
- Click Copy Code to grab the tracking snippet.
Step 3: Add the Meta Pixel Code to WordPress
Head over to your WordPress site. You’ll need to insert the Meta Pixel code into the site-wide header. To do this, you’ll need a plugin that lets you add custom code.
- Go to Plugins > Add New.
- Search for a plugin like WPCode (or similar snippet inserters).
- Install and activate the plugin.
- Navigate to Code Snippets > Add New.
- Paste the Meta Pixel code into the snippet box.
- Set the snippet type to HTML, and ensure the location is set to Site-Wide Header.
- Save and toggle the snippet on.
You’ve now embedded your Pixel on every page of your site.
Step 4: Verify Your Pixel Setup
To confirm that your Meta Pixel is working:
- Return to your Meta Pixel dashboard.
- Navigate to the Test Events tab.
- Enter your website URL and click Open Website.
- Interact with your site (click around a few pages).
- Go back to Meta, and look for Page View events to appear.
If you see them, you’re good to go.
Step 5: Connect Your Pixel to Your Ad Account
Now that the pixel is firing, we want to connect it to the correct ad account.
- In your Meta dashboard, go to Settings > Connected Assets.
- Click Add Assets, then select the correct Ad Account.
- Click Add, and you’re done!
Note: You may be asked to verify your email during this process.
Selecting Your Pixel When Creating Ads
When setting up a new campaign in Meta Ads Manager, you’ll now be able to select your Pixel under the event setup section. Make sure you’re using the correct one (e.g., “My Testing Pixel”).
Setting up the Meta Pixel manually gives you flexibility and helps ensure your tracking is accurate. Once installed, you’ll be able to:
- Measure conversions
- Retarget users
- Optimize ads based on real behaviour