Grow your business with Facebook for WordPress! This plugin will install a Facebook Pixel for your page so you can capture the actions people take when they interact with your page, such as Lead, ViewContent, AddToCart, InitiateCheckout and Purchase events. Version 2.0.0 also includes support for the Conversions API, which lets you send events directly from your page’s server so you can capture a more of these events when they happen. This can help you better understand your customer’s journey from the moment they show interest in your business to the moment they complete a conversion. You can use this information to create ad campaigns that are relevant to your audience. Learn More
Facebook for WordPress requires
- WordPress 5.7 or higher
- PHP 8.0 or greater
Clone this repo with the following command:
$ git clone https://github.com/facebookincubator/facebook-pixel-for-wordpress.git
Initiate the development environment:
- Install Composer
- Run the command to install the necessary package:
$ composer install
Build the project and create the zip Run the command to run tests and create the zip under build directory.
$ vendor/bin/phing
https://www.facebook.com/business/help/881403525362441
- Add your integration class under
integration/
folder - Extend the class from
FacebookWordpressIntegrationBase
- Define class variable
PLUGIN_FILE
to be your plugin PHP file - Define class variable
TRACKING_NAME
for tracking purpose, put this value under 'fb_wp_tracking' as a parameter in the pixel event - Define a public static function
injectPixelCode()
to inject pixel at your page - Add your unit test class under
tests/
folder - Extend the test class from
FacebookWordpressTestBase
- After the classes development, run tests by
$ vendor/bin/phing
You can reference to integration/FacebookWordpressContactForm7.php and tests/FacebookWordpressContactForm7Test.php as an example
See the CONTRIBUTING file for how to help out
Facebook for WordPress is GPLv2-licensed