Grow your business with Facebook for WordPress! This plugin will install a Facebook Pixel for your page. There is also built in support for other WordPress plugins, such as Contact Form 7, Easy Digital Downloads, Ninja Forms, and WPForms. The Official Facebook Pixel allows you to fire lower funnel events: Lead, ViewContent, AddToCart, InitiateCheckout and Purchase. Tracking lower funnel events can help you understand the actions people are taking on your website. You can then use this information to make adjustments accordingly in your advertising campaigns.
Official Facebook Pixel requires
- WordPress 4.4+ or higher
- PHP 5.3 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
Official Facebook Pixel is GPLv2-licensed