The Facebook pixel is amongst the most useful tools that Facebook has created. Perhaps you already know the benefits of the Facebook pixel, and have already created one on your Facebook Ads account. Here is how to add the Facebook Pixel to your WordPress site without using a Plugin.
This article will show you how to insert the Pixel code into the header section of your website. This will install the Pixel throughout your entire site.
If you use a tag manager like Google Tag Manager, you should insert the Pixel code onto your WordPress site using the tag manager.
Step 1: Find and Copy your Pixel code
- Go to Events Manager in Facebook. and click on the “Set up” button.
- On the next screen, click on “Manually Install the Code Yourself”.
- Copy the entire Pixel code which we will then insert into your WordPress site.
Step 2: Insert Pixel Code into WordPress header
In your WordPress admin console, go to Appearance > Customise. Find if there is a place somewhere in your Theme settings to allow you to easily insert scripts into the theme header. If so, simply paste your Pixel code (from Step 1) into this section. And you’re done!
If your theme settings does not have this option, install a WordPress header and footer management plugin. This will give you a user interface similar to the above. There are two free WordPress plugins which I would recommend for this: “Head, Footer and Post Injections” and “Insert Headers and Footers“.
Alternatively, you will have to edit your Theme’s header code via the header.php file. You will have to update this again if you change themes. Find the header.php file via Appearance > Editor in your WordPress admin console. Locate the </head> tag and paste the Pixel code (from Step 1) just above the </head> tag. Click “Update file” and you’re all set!
Step 3: Check that your Pixel is working
Go to the Pixels tab in Facebook Ads manager and click on “Send Test Traffic”. If its status changes to Active (this might take a few minutes to update), then it means the Pixel code has been installed correctly.
Alternatively, you may also use the Chrome browser (download link) and install the Facebook Pixel Helper extension. The Facebook Pixel Helper is a great free tool that helps you check that your Pixel is working correctly, and to troubleshoot any errors. You can also use it to find out if your competitors are using Facebook pixel on their websites!
Once you’ve successfully installed the extension you’ll see a notification that the plugin has been added to Chrome and a small icon will show in your address bar. Click the Pixel Helper icon in the address bar and check the popup to see any pixels found on that page, and whether they’ve been set up successfully.
If the Pixel Helper finds a pixel on your site and there are no errors, then congratulations! You’re all set and ready to start multiplying your Facebook ad success.
If the Pixel Helper could not find a Pixel or reports an error, then visit the troubleshooting guide.
Want to use a WordPress plugin instead? Find out how.