How to add Facebook Pixel to WordPress without a Plugin

Do you want expert help in setting up/fixing GA4 and GTM?

If you are not sure whether your GA4 property is setup correctly or you want expert help migrating to GA4 then contact us. We can fix your website tracking issues.

Prerequisites for adding a Facebook pixel to WordPress website without a plugin:

  1. You have a Google Tag Manager account.
  2. Google Tag Manager is installed on your website.
  3. You have the publish permission at the GTM container level.
  4. You have an active Facebook Business Manager account.
  5. You have at least one Facebook ad account which is linked to your Facebook business manager account.
  6. You have the ‘Manage Ad Account’ access for the Facebook ad account.

Follow the steps below to add Facebook Pixel to your wordpress website (or infact any website) without a Plugin:

Step-1: Navigate to your Facebook Events Manager: https://www.facebook.com/events_manager2/list/

Step-2: Click on your Facebook pixel:

Click on your Facebook pixel 1

Step-3: Click on the ‘Manage Integrations’ button:

Manage Integrations 1

You should now see a dialogue box like the one below:

integrations 1

Step-4: Click on the ‘Manage’ drop-down menu next to ‘Browser pixel’ and then click on ‘Add to another website’:

Add to another website 1

You should now see a window like the one below:

use a partner integration

Step-5: Click on the ‘Install Code Manually‘ button:

install manually

Step-6: Click on the ‘Copy Code‘ button to copy the Facebook default pixel code:

copy code

Have this code ready in your note pad, the code will look like below:

<!-- Facebook Pixel Code -->

<script>

!function(f,b,e,v,n,t,s)

{if(f.fbq)return;n=f.fbq=function(){n.callMethod?

n.callMethod.apply(n,arguments):n.queue.push(arguments)};

if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';

n.queue=[];t=b.createElement(e);t.async=!0;

t.src=v;s=b.getElementsByTagName(e)[0];

s.parentNode.insertBefore(t,s)}(window, document,'script',

'https://connect.facebook.net/en_US/fbevents.js');

fbq('init', '124346276306212');

fbq('track', 'PageView');

</script>

<noscript><img height="1" width="1" style="display:none"

src="https://www.facebook.com/tr?id=124346664646464&ev=PageView&noscript=1"

/></noscript>

<!-- End Facebook Pixel Code -->

Step-7: Click on the ‘Continue‘ button at the bottom of the page.

continue

Step-8: Toggle on the ‘Automatic Advanced Matching‘ option. Use this setting according to your privacy policy. Then click on the ‘Continue‘ button.

advance matching manually

You should now see a screen like the one below:

add events using event set up tool

Step-9: Log in to your Google Tag Manager account and create a new custom HTML tag.

Step-10: Name your new tag ‘Facebook default pixel code’ and then paste the Facebook pixel code in the text area:

facebook default pixel code

Step-11: Set the tag to fire on all pages of your website:

all pages

Step-12: Save your new tag and then preview it to see whether it fires on all of your web pages.

Step-13: Publish your container.

Step-14: Navigate back to the Events Manager Onboarding screen and then click on the ‘Continue‘ button:

continue button

Step-15: Click on the ‘Verify Domain‘ button and then follow the on-screen instructions in order to verify your domain with Facebook:

verify dmain facebook 1

Step-16: Click on the ‘Continue‘ button:

continue button 2

Step-17: Click on the ‘Configure Web Events‘ button and then follow the on-screen instructions in order to configure and prioritize up to 8 events that matter most to businesses. This step is required in order to reduce the negative impact of the Apple IOS 14.5 update on Facebook ads.

configure web events facebook

Step-18: Click on the ‘Go to Pixel Overview‘ button:

go to pixel overview

Do you want expert help in setting up/fixing GA4 and GTM?

If you are not sure whether your GA4 property is setup correctly or you want expert help migrating to GA4 then contact us. We can fix your website tracking issues.


My step-by-step blueprint for selecting the best Excel charts for data analysis and reporting (40 pages)

Get the FREE e-book on Best Excel Charts For Data Analysis And Reporting (40 Pages)

Download the FREE ebook

 

  1. How to add Facebook Pixel to Google Tag Manager
  2. facebook.com Referral Traffic in Google Analytics Explained
  3. Facebook Attribution and Conversion Windows Tutorial
  4. Facebook ROI Calculation, Analysis and Examples
  5. How to set up the Facebook Attribution Tool
  6. How to Setup Funnels in Facebook Ads Manager
  7. How to use funnels for your Facebook Ad Campaigns
  8. How to advertise on Facebook for FREE with unlimited budget
  9. Facebook Pixel vs Google Analytics Data Discrepancies
  10. facebook.com Referral Traffic in Google Analytics Explained
  11. Send Facebook Pixel Purchase Event via Google Tag Manager
  12. Open Graph Protocol for Facebook Explained with Examples
  13. Tracking Facebook ‘Likes’ and ‘Unlikes’ in Google Analytics
  14. Google Analytics for Facebook Tutorial
  15. Facebook Attribution Models Tutorial
  16. GTM Server Side Tagging for Facebook Tutorial
  17. The impact of Apple IOS 14.5 update on Facebook Ads
  18. How to add Facebook Pixel to WordPress Website
  19. How to track Facebook events via Google Tag Manager
  20. How to use the Facebook Event Setup Tool
  21. How to use the Facebook Pixel Helper to Test Facebook Events
  22. How to automatically turn off Facebook ads on weekends
  23. How to name Facebook Ad Campaigns like a Pro

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade