Download the PHP package thelia/meta-conversions-api-module without Composer

On this page you can find all versions of the php package thelia/meta-conversions-api-module. 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 meta-conversions-api-module

Meta Conversions Api

Sends the conversions of the shop to the Meta Conversions API, from the server: PageView, AddToCart, InitiateCheckout, CompleteRegistration and Purchase.

Thelia 3.2 or later. The 2.x line of this module is for Thelia 2.

Installation

Nothing is sent unless the environment variable META_CONVERSION_ENV is prod (in .env.local of the production server only): a copy of the production database never writes into the merchant's Meta account.

Configuration

In the back office, module configuration page:

Setting
Pixel Id the Meta pixel (digits)
Token the access token of the Conversions API; the field is never filled back, leave it empty to keep the saved token
Active Tracker nothing is sent while unticked
Send the customer personal data e-mail, phones, names, city, zip code, country and customer reference, hashed in SHA-256 after the normalisation Meta asks for: lower case and trimmed, names reduced to their letters, phones in digits with the calling code of the address country and without the national 0 (33612345678)
Send only with the visitor consent on by default; see below
Meta vendor name in the consent tool facebook_pixel by default
Days the visitor details of an unpaid order are kept 30 by default, see Purchase
Test Event Code, Test Mode the code of the Meta test events tool, sent while the test mode is ticked

Events

Event When Shared identifier with the pixel
PageView every HTML page of the shop answering a GET (not the back office, the API, an XHR, a Turbo frame or a live component) no
AddToCart a product added to the cart (CART_ADDITEM), with the added quantity; not for a product offered by a coupon yes, see below
InitiateCheckout a delivery address chosen (CART_SET_DELIVERY_ADDRESS), once per visit until an order is placed no
CompleteRegistration an account created from the front office (CREATE_CUSTOMER_MINIMAL, CUSTOMER_CREATEACCOUNT) no
Purchase an order reaching the paid status the order reference

The events of a request are queued and sent in a single call once the response is gone (kernel.terminate, or the end of a command), with a 2 second timeout. Unit prices and values include taxes. A failure is logged, without the token, and never thrown: a failure of the module never stops a page, a cart, an order or a payment.

The response leaves before the call only under PHP-FPM, where Symfony calls fastcgi_finish_request() before kernel.terminate. Under another server API (mod_php, the PHP built-in server) the visitor waits for the call, up to the timeout. After 5 failures in a row (timeout, error answer), nothing is sent for 10 minutes (state kept in the cache.app pool), so that an unreachable Meta does not hold every PHP worker; the events of that window are dropped.

Consent

With "Send only with the visitor consent" ticked, a visitor event leaves only when the visitor accepted the Meta vendor in Axeptio (cookie axeptio_authorized_vendors, or axeptio_cookies). For Purchase, the consent is the one given when the order was placed: a visitor who withdraws it afterwards still sends the Purchase of that order. The vendor must be declared in the Axeptio project, otherwise nobody can accept it and nothing is sent. Another consent tool plugs in by aliasing MetaConversionsApi\Service\VisitorConsentInterface to its own reader.

Purchase

The paid status is often set without the visitor's browser: the server call of a payment provider, a cheque or a transfer recorded later by the merchant. When the visitor places the order (ORDER_BEFORE_PAYMENT), the module freezes on the order, in the core meta_data table (key meta_conversions_api_visitor), the browser details of a consenting visitor: IP address, user agent, _fbc and _fbp cookies, page address. Purchase reads them, never the request that marks the order paid. An order without them sends no Purchase: the visitor refused, or the order was created from the back office or the command line.

These details are personal data, kept only as long as they are needed:

Identifier shared with the pixel

The theme gets the identifier of the last AddToCart sent by the server with the Twig function meta_conversions_api_event_id('AddToCart') (read once, null when none is waiting) and passes it as eventID to the pixel, so that Meta counts the conversion once. Purchase uses the order reference.

Tests

Run from the root of the Thelia project, against a disposable test database whose name ends with _test:

Nothing leaves the machine: the Conversions API is replaced by a mock.

Changes in 3.0.0


All versions of meta-conversions-api-module with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
thelia/installer Version ^1.6
symfony/http-client Version ^7.4 || ^8.0
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 thelia/meta-conversions-api-module contains the following files

Loading the files please wait ...