PHPackages                             eflyax/facebook-pixel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eflyax/facebook-pixel

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

eflyax/facebook-pixel
=====================

Facebook pixel for Nette

v2.1(8y ago)10941BSD-3-ClausePHPPHP &gt;= 5.3.7

Since Oct 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Eflyax/facebook-pixel)[ Packagist](https://packagist.org/packages/eflyax/facebook-pixel)[ RSS](/packages/eflyax-facebook-pixel/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

Nette extension for Facebook Pixel.
===================================

[](#nette-extension-for-facebook-pixel)

TODO

- support for ajax

Requirements
------------

[](#requirements)

- [Nette/Application](https://github.com/nette/application)

Installation
------------

[](#installation)

The best way to install Eflyax/Facebook-pixel is using [Composer](http://getcomposer.org/):

```
$   composer require eflyax/facebook-pixel
```

Usage
-----

[](#usage)

### Preparation

[](#preparation)

#### Extension registration

[](#extension-registration)

Add to your neon config:

```
extensions:
    facebookPixel: Eflyax\FacebookPixel\DI\FacebookPixelExtension

```

and configuration with you FB pixel ID:

```
facebookPixel:
    id: '111122223333444'
    productIdPrefix: '42' # optional

```

Be careful you add FB pixel ID as string, there was issues with integer

#### Backend

[](#backend)

Inject FB pixel factory and service to your module where you want to render FB pixel. FB pixel service will help you to render specific events.

```
abstract class BaseFrontPresenter extends BasePresenter
{

    /** @var IFacebookPixelFactory @inject */
    public $IFacebookPixelFactory;

    /** @var FacebookPixel */
    public $facebookPixel;

    protected function startup()
    {
        parent::startup();
        $this->facebookPixel = $this['facebookPixel'];
    }

    .
    .

    protected function createComponentFacebookPixel()
    {
        return $this->IFacebookPixelFactory->create();
    }

}
```

#### Frontend

[](#frontend)

Now you are ready to render FB pixel in layout

`{control facebookPixel}`

### Events

[](#events)

#### AddToCart

[](#addtocart)

In method where you add product to cart call eventStart like this:

```
    $this->facebookPixel->addToCart(
        $productId,
        $productTitle,
        $productCategory,
        $productPrice,
        $currencyCode
    );
```

#### Purchase

[](#purchase)

```
  $this->facebookPixel->purchase($totalPrice, $currencyCode);

```

#### ViewContent

[](#viewcontent)

For one product:

```
$this->facebookPixel->viewContent(
    $productId,
    $productTitle,
    $productCategory,
    $productPrice,
    $currencyCode
);
```

For more products (category):

```
$this->facebookPixel->viewContent(
    $productIds
);
```

Events validation
-----------------

[](#events-validation)

If you want to validate events which you send to facebook I can recommend this browser plugin: [Facebook Pixel Helper](https://chrome.google.com/webstore/detail/FacebookPixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc)

How to run tests
----------------

[](#how-to-run-tests)

```
$   cd tests
$   composer install
$   mkdir temp
$   ./vendor/bin/codecept build
$   ./vendor/bin/codecept run
```

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

3

Last Release

3202d ago

Major Versions

1.0-stable → v2.02017-11-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10993320?v=4)[Jakub Záruba](/maintainers/Eflyax)[@Eflyax](https://github.com/Eflyax)

---

Top Contributors

[![Eflyax](https://avatars.githubusercontent.com/u/10993320?v=4)](https://github.com/Eflyax "Eflyax (9 commits)")

---

Tags

extensionfacebookfacebook-pixelnette

### Embed Badge

![Health badge](/badges/eflyax-facebook-pixel/health.svg)

```
[![Health](https://phpackages.com/badges/eflyax-facebook-pixel/health.svg)](https://phpackages.com/packages/eflyax-facebook-pixel)
```

###  Alternatives

[nette/web-project

Nette: Standard Web Project

11093.7k](/packages/nette-web-project)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
