Download the PHP package setono/sylius-facebook-tracking-plugin without Composer

On this page you can find all versions of the php package setono/sylius-facebook-tracking-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-facebook-tracking-plugin

Sylius Facebook Plugin

Latest Version Build Status

Track ecommerce events in your store and send them to Facebook to enable your marketing efforts inside Facebook.

Installation

Step 1: Download the plugin

The plugin builds on the Meta Conversions API bundle and the Meta Conversions API PHP SDK. Until their next stable releases are out you have to allow their pre-releases in your own composer.json, because a stability flag on a dependency's requirement is not inherited:

The SDK depends on php-http/discovery, which contains a Composer plugin. Composer asks whether to allow it, and either answer works. To skip the prompt, e.g. in CI, declare it in your composer.json:

Step 2: Enable the plugin

Then, enable the plugin by adding it to the list of registered plugins/bundles in config/bundles.php file of your project before (!) SyliusGridBundle:

OPTIONAL: If you want to enable consent (i.e. cookie / GDPR) you can install the consent bundle.

Step 3: Configure plugin

Step 4: Import routing

Step 5 (recommended): Send the events asynchronously

Events are sent to Meta with your application's HTTP client (psr18.http_client), which a Sylius application already ships with, so requests show up in the profiler and honour your timeouts.

By default an event is sent while the page that raised it is rendered. To take that request off your visitors' page loads, route the command to a Messenger transport:

Neither the access token nor any unhashed personal data is written to the transport. The access tokens are added back from the pixels you have created in the admin when the worker sends the event, so an event for a pixel that was disabled or removed in the meantime is not sent.

The command is dispatched on your default bus, sylius.command_bus in a Sylius application. Set setono_meta_conversions_api.server_side.message_bus to use another one. See the bundle's documentation for all the options: consent, client side tracking, user agent filters and a dedicated HTTP client.

Step 6: Update your database schema

Step 7: Create a pixel

When you create a pixel in Facebook you receive a pixel id.

Now create a new pixel in your Sylius shop by navigating to /admin/facebook/pixels/new. Remember to enable the pixel and enable the channels you want to track.

Step 8: You're ready!

The events that are tracked are located in the EventSubscriber folder, but here's a list:

Test the integration

Find the test event code in the Test events tab of Meta's Events Manager and append it to any URL of your shop: https://example.com/?_testEventCode=TEST12345. It is stored in the session, so the events of the following page views show up in Events Manager too. ?_testEventCode= (empty) clears it again.

The query parameter is only honoured when kernel.debug is true. To use it in production, enable it explicitly:

Events are sent to the Graph API version of the installed facebook/php-business-sdk (v26.0 with 26.x). Run composer update facebook/php-business-sdk to move to a newer version.

Related links

Contribute

Ways you can contribute:

Thank you!


All versions of sylius-facebook-tracking-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
doctrine/collections Version ^1.6
fakerphp/faker Version ^1.19
knplabs/knp-menu Version ^3.3
psr/event-dispatcher Version ^1.0
psr/log Version ^1.1 || ^2.0 || ^3.0
setono/meta-conversions-api-bundle Version ^1.0.0-beta.1
setono/meta-conversions-api-php-sdk Version ^2.0.0-beta.2
sylius/channel Version ^1.0
sylius/channel-bundle Version ^1.0
sylius/core Version ^1.0
sylius/core-bundle Version ^1.0
sylius/locale Version ^1.0
sylius/order Version ^1.0
sylius/product Version ^1.0
sylius/resource-bundle Version ^1.6
sylius/taxonomy Version ^1.0
sylius/ui-bundle Version ^1.0
symfony/config Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/event-dispatcher Version ^6.4
symfony/form Version ^6.4
symfony/http-foundation Version ^6.4
symfony/http-kernel Version ^6.4
symfony/options-resolver Version ^6.4
webmozart/assert Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package setono/sylius-facebook-tracking-plugin contains the following files

Loading the files please wait ...