Download the PHP package setono/sylius-plausible-plugin without Composer

On this page you can find all versions of the php package setono/sylius-plausible-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-plausible-plugin

Sylius plugin integrating Plausible Analytics

Latest Stable Version Total Downloads License PHP Version Require build codecov Mutation testing badge

Use Plausible Analytics to track visitors and events in your Sylius store.

This plugin supports Sylius 1.x.

Installation

Step 1: Install and enable the plugin

Step 2: Register the tag bag bundle

The plugin outputs its JavaScript through setono/tag-bag-bundle. If the bundle isn't registered already (Symfony Flex does this for you), add it to config/bundles.php:

Step 3: Render the tag bag in your shop layout

Nothing is rendered until you call the tag bag's Twig functions. Add them to your shop layout:

[!IMPORTANT] If you skip this step the plugin will appear to work, but no tracking code is ever written to the page.

Step 4: Add the Plausible script identifier trait to your Channel entity

Make sure the channel resource points at your own class:

Step 5: Import routes

Step 6: Update your database schema

Usage

Configure Plausible per channel

Navigate to Marketing > Plausible in the admin panel to configure the Plausible script for each channel.

You can enter the Plausible script in any of the following formats:

The plugin will normalize any of these formats and output the correct script tag on your storefront.

Disabling tracking

Tracking is enabled by default. Turn it off in environments that shouldn't report to Plausible, for instance staging:

While disabled, none of the tracking services are registered at all, so no listener runs and no work is done. The admin UI stays available, so you can still configure your channels.

Self-hosted Plausible

If you run Plausible Community Edition, point the plugin at your own host:

The script is then loaded from https://analytics.example.com/js/<identifier>.js. Defaults to https://plausible.io.

What gets tracked

The plugin sends five custom events. Each one is written to the page as a plausible(...) call by setono/tag-bag, so an event triggered by a form submission fires on the next page the visitor sees.

Event name Fires when
Begin Checkout The visitor lands on the checkout start route
Address The addressing step is completed
Select Shipping Method The shipping step is completed
Select Payment Method The payment step is completed
Purchase The visitor reaches the thank you page

Properties

Every event carries the properties of the order it relates to. For the four checkout events that is the current cart; for Purchase it is the completed order.

Property Type Notes
order_id int
order_number string
order_total float Major units, i.e. 100.0, not 10000
tax_total float
shipping_total float
order_promotion_total float Negative
payment_method string Payment method code
shipping_method string Shipping method code
coupon_code string

Properties that are null or an empty string are left out, so an order without a coupon has no coupon_code property rather than an empty one. No customer data is sent.

The Purchase event additionally carries revenue:

[!NOTE] Custom properties and revenue have to be enabled in your Plausible dashboard before they show up. See custom properties and revenue tracking.

Tracking your own events

Dispatch the plugin's event and it is turned into a plausible(...) call for you:

To add properties to the events the plugin already sends, listen to the same event class. The subscriber that renders the tag runs at priority -100, so a listener at the default priority still gets a say:

[!WARNING] Property values end up inside an inline <script> tag. The plugin escapes them, but keep customer supplied data out of your properties unless you have a good reason to send it — Plausible is not the place for personal data.


All versions of sylius-plausible-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/dbal Version ^3.2
doctrine/orm Version ^2.0
doctrine/persistence Version ^2.0 || ^3.0
psr/event-dispatcher Version ^1.0
psr/log Version ^1.1 || ^2.0 || ^3.0
setono/doctrine-orm-trait Version ^1.2
setono/tag-bag Version ^2.4
setono/tag-bag-bundle Version ^3.0
sylius/admin-bundle Version ^1.0
sylius/channel Version ^1.0
sylius/core Version ^1.0
sylius/core-bundle Version ^1.0
sylius/order Version ^1.0
sylius/resource-bundle Version ^1.6
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
symfony/security-bundle Version ^6.4
symfony/security-csrf Version ^6.4
symfony/serializer Version ^6.4.30
twig/twig Version ^2.15 || ^3.22
webmozart/assert Version ^1.12
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-plausible-plugin contains the following files

Loading the files please wait ...