PHPackages                             xddesigners/silverstripe-facebook-serverside-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. xddesigners/silverstripe-facebook-serverside-pixel

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

xddesigners/silverstripe-facebook-serverside-pixel
==================================================

Serverside pixel implementation for use with silverstripe (and SilverShop)

161PHP

Since Dec 14Pushed 2y ago2 watchersCompare

[ Source](https://github.com/xddesigners/silverstripe-facebook-serverside-pixel)[ Packagist](https://packagist.org/packages/xddesigners/silverstripe-facebook-serverside-pixel)[ RSS](/packages/xddesigners-silverstripe-facebook-serverside-pixel/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe Facebook Serverside pixel
======================================

[](#silverstripe-facebook-serverside-pixel)

Add serverside fb pixel tracking to your silverstripe site, or silvershop products (if installed).

Install
-------

[](#install)

```
composer require xddesigners/silverstripe-facebook-serverside-pixel
```

Get your pixel id and access token and set these in your environment (.env) file.

```
FB_ACCESS_TOKEN="FB_ACCESS_TOKEN"
FB_PIXEL_ID="FB_PIXEL_ID"
FB_TEST_EVENT_CODE="OPTIONAL"
```

Configuration
-------------

[](#configuration)

By default the pageview event is added to the SiteTree class. If you have a SilverShop you'll also want to enable the extensions on Order and CheckoutPage:

```
SilverShop\Model\Order:
  extensions:
    - XD\SilverStripeFacebookServerSidePixel\Extensions\OrderExtension
SilverShop\Page\CheckoutPage:
  extensions:
    - XD\SilverStripeFacebookServerSidePixel\Extensions\CheckoutPageExtension
```

Add custom events
-----------------

[](#add-custom-events)

You can push custom events by using the following methods:

```
// Initiate the Client
$client = new XD\SilverStripeFacebookServerSidePixel\Client\Client();

// Generate user date from the current session.
$userData = $client->createUserData();

// Enricht the user data (Optional)
$userData->setEmail('user@email.com');

// Create the custom data to send to your event, for example a cart (Optional)
$product = (new Content())
    ->setProductId('my_product_id')
    ->setTitle('product_title')
    ->setQuantity(2)
    ->setItemPrice(57.25)
    ->setDeliveryCategory(DeliveryCategory::HOME_DELIVERY);

$customData = (new CustomData())
    ->setOrderId('my_order_id')
    ->setContents([$product])
    ->setCurrency('eur')
    ->setContentType('product')
    ->setValue(114.50);

// add the event (multiple events can be chained) and send the events
$client
    ->addEvent('MyCustomEvent', $userData, $customData)
    ->sendEvents();
```

Support for FB Event IDs
------------------------

[](#support-for-fb-event-ids)

add to index.php:

```
session_start();
$event_id = sha1(session_id() . '_' . uniqid() );
setcookie('EVENTID',$event_id);
$_SESSION['EVENTID'] = $event_id;
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 54.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6131c03b7f5ba6b10fef192c90d68d57508e84c007a13321df6960b8298e19d1?d=identicon)[TheBnl](/maintainers/TheBnl)

---

Top Contributors

[![RVXD](https://avatars.githubusercontent.com/u/1586761?v=4)](https://github.com/RVXD "RVXD (6 commits)")[![TheBnl](https://avatars.githubusercontent.com/u/1334195?v=4)](https://github.com/TheBnl "TheBnl (5 commits)")

### Embed Badge

![Health badge](/badges/xddesigners-silverstripe-facebook-serverside-pixel/health.svg)

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

###  Alternatives

[z3d0x/filament-fabricator

Block-Based Page Builder Skeleton for your Filament Apps

373158.4k3](/packages/z3d0x-filament-fabricator)[matthiasmullie/geo

Geography helper

6377.6k1](/packages/matthiasmullie-geo)[nasyrov/laravel-enums

Laravel package for Enum implementation.

3272.5k](/packages/nasyrov-laravel-enums)[mnapoli/pretty

Run all code formatting tools with one command: pretty

1085.1k9](/packages/mnapoli-pretty)[mestrona/magento-module-categoryredirect

Magento 2 Module to simply customize the menu with additional URLs: Create a category, enter the redirect, done.

2343.0k](/packages/mestrona-magento-module-categoryredirect)[kphoen/rulerz-spec-builder

Specification builder for RulerZ

1149.5k](/packages/kphoen-rulerz-spec-builder)

PHPackages © 2026

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