# magefan/module-facebook-pixel

> Facebook Pixel for Magento 2

`composer require magefan/module-facebook-pixel`

Canonical URL: https://packagento.com/magefan/module-facebook-pixel

## At a glance

- **Vendor**: magefan (https://packagento.com/magefan.md)
- **Latest version**: 2.7.2 — released 2026-01-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/magefan/module-facebook-pixel and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require magefan/module-facebook-pixel:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Facebook Pixel for Magento 2

## README

[![Total Downloads](https://poser.pugx.org/magefan/module-facebook-pixel/downloads)](https://packagist.org/packages/magefan/module-facebook-pixel)
[![Latest Stable Version](https://poser.pugx.org/magefan/module-facebook-pixel/v/stable)](https://packagist.org/packages/magefan/module-facebook-pixel)

<img align="right" width="120" height="120" src="https://cm.magefan.com/catalog/product/cache/28b407cef1668fd0bdd6f36db3e8e2f0/i/c/icon-facebook-pixel.jpg">

[Magento 2 Facebook Pixel](https://magefan.com/magento-2-facebook-pixel-extension) is the solution that enables you to integrate Facebook pixel tracking code to Magento without any technical knowledge. You just need your Facebook Pixel ID. 

Track product performance, follow customers’ journey on checkout and use that information to personalise your Facebook campaigns.

<img  align="right" width="120" height="70" src="https://magefan.com/media/wysiwyg/made_in_ukraine.jpg">

<a href="https://magefan.com/magento-2-facebook-pixel-extension"><img width="190" height="70" src="https://cm.magefan.com/wysiwyg/products/download-magefan-extensions.png"></a>

### Useful Links
  * [User Guide](https://magefan.com/magento-2-facebook-pixel-extension/documentation)
  * [Change Log](https://magefan.com/magento-2-facebook-pixel-extension/change-log)
  * [FAQs](https://magefan.com/magento-2-facebook-pixel-extension#pattr-faq)

### 🇺🇦 Stand with Ukraine! [How can you help?](https://magefan.com/blog/join-our-donations)

### Requirements
  * Magento Community 2.3.0-2.4.x (CE, EE, ECE, B2B)
  * [Magefan Community Extension](https://github.com/magefan/module-community) >= v2.1.20. Please install this extension first if you use installation via FTP.
  * **Note** that the extension is free only for the Magento Community (Open Source) Edition. For Magento EE, ECE, and B2B you need to purchase the license  at magefan.com.
  
  ## Editions & Pricing
  
<a href="https://magefan.com/magento-2-facebook-pixel-extension/pricing">
          <img
            src="https://cm.magefan.com/wysiwyg/products/facebook-pixel-pricing-plans.png"
            alt="Plans and Pricing for Magento 2 Facebook Pixel Extension" />
        </a>

### Benefits
* [Integrate Tracking Pixel from the Admin Panel](https://github.com/magefan/module-facebook-pixel#integrate-tracking-pixel-from-the-admin-panel)
* [Optimize Facebook Ads](https://github.com/magefan/module-facebook-pixel#optimize-facebook-ads)
* [Improve Conversion Rates](https://github.com/magefan/module-facebook-pixel#improve-conversion-rates)
* [Track Customers’ Behaviour on Checkout](https://github.com/magefan/module-facebook-pixel#track-customers-behaviour-on-checkout)
* [Monitor Product Performance](https://github.com/magefan/module-facebook-pixel#monitor-product-performance)
* [Gather Data About Customers’ Interactions with Your Store](https://github.com/magefan/module-facebook-pixel#gather-data-about-customers-interactions-with-your-store)
* [Optimize Facebook Pixel Loading](https://github.com/magefan/module-facebook-pixel#optimize-facebook-pixel-loading)
* [Create Localized Ads on Facebook](https://github.com/magefan/module-facebook-pixel#create-localized-ads-on-facebook)

### Features

#### Integrate Tracking Pixel from the Admin Panel

While it was relatively hard to set up Facebook Pixel in Magento 2 before due to a lack of technical knowledge, anyone can do it now. You just need the right tool 一 Magento 2 Facebook Pixel by Magefan. 

It enables you to track vital eCommerce events simply by adding your Facebook Pixel ID in the admin panel. The extension covers the rest. 


<p align="center">
  <img width="853" height="425" src="https://cm.magefan.com/catalog/magento-2-facebook-pixel.png">
</p>


#### Optimize Facebook Ads
  
If you know how customers interact with your store, you can use that information to improve ads. Custom events like purchase, add to cart, add payment info, product view and others help you to segment your audience. 

You can then show personalized ads to people who viewed your products but didn’t purchase anything, those who started buying, but abandoned checkout and those who just created an account. Opportunities are limitless. 


#### Improve Conversion Rates

The more information you have on your customers' behaviour, the better you can tweak your Facebook ads to drive more conversions. 

You can’t launch Facebook retargeting or remarketing campaigns using intuition and expect it to yield the results. Drive more sales by collecting data with Magento 2 Facebook Pixel Extension.

<p align="center">
  <img width="853" height="425" src="https://cm.magefan.com/catalog/purchase-event-facebook-pixel.png">
</p>

#### Track Customers’ Behaviour on Checkout

Checkout is one of the most important steps in the customer journey. It is also one of the stages customers tend to abandon. Having insights into how your customers behave on checkout helps you drive them back.

Use the checkout page view, add payment information and checkout success page view events to segment customers. You can then retarget them using Facebook campaigns.


#### Monitor Product Performance

Tracking what products customers view, add to cart and wishlist allows you to learn your audience better. Not only does it allow you to improve your catalogue and discover reasons why customers’ visit didn’t end with a sale. 

It also helps you to address people who left your website without making a purchase. Make sure no visit goes unnoticed and do the best you can to drive people back to your store. Magento 2 Facebook Pixel extension will provide all the data needed do to that.

<p align="center">
  <img width="853" height="425" src="https://cm.magefan.com/catalog/facebook-pixel-track-product-views.png">
</p>

#### Gather Data About Customers’ Interactions with Your Store

_(README truncated for .md surface. Full README on https://packagento.com/magefan/module-facebook-pixel.)_

## Recent Versions

| Version | Released |
|---|---|
| 2.7.2 | 2026-01-15 |
| 2.7.1 | 2025-10-23 |
| 2.7.0 | 2025-08-07 |
| 2.6.9 | 2025-06-23 |
| 2.6.8 | 2025-05-06 |
| 2.6.7 | 2025-02-04 |
| 2.6.6 | 2024-12-13 |
| 2.6.5 | 2024-10-23 |
| 2.6.4 | 2024-10-15 |
| 2.6.3 | 2024-07-05 |

Showing 10 of 22 versions. Full release history on https://packagento.com/magefan/module-facebook-pixel.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magefan/module-community | >=2.3.3 |

## Quality

Latest release (2.7.2) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Pass | 0 |  |
| PHPMD | Warning | 10 | 10 rule violations (IfStatementAssignment:5, UnusedFormalParameter:2, EmptyCatchBlock:2, UnusedLocalVariable:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 2 | valid; 2 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 50 | 50 | – | – |
| 2.4.8 | – | 59 | 59 | – |
| 2.4.9 | – | – | 59 | 59 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["magefan/module-facebook-pixel"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

magefan is a Magento 2 vendor on Packagento. See https://packagento.com/magefan.md for their full catalogue.

