setono / sylius-plausible-plugin
Start tracking your visitors with Plausible.io
Fund package maintenance!
Setono
Installs: 8 075
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:sylius-plugin
pkg:composer/setono/sylius-plausible-plugin
Requires
- php: >=8.1
- psr/event-dispatcher: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- setono/tag-bag: ^2.4
- setono/tag-bag-bundle: ^3.0
- sylius/core: ^1.0
- sylius/core-bundle: ^1.0
- sylius/order: ^1.0
- symfony/config: ^5.4 || ^6.4 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.4 || ^7.0
- symfony/event-dispatcher: ^5.4 || ^6.4 || ^7.0
- symfony/http-kernel: ^5.4 || ^6.4 || ^7.0
- symfony/serializer: ^5.4 || ^6.4 || ^7.0
- symfony/string: ^5.4 || ^6.4 || ^7.0
- webmozart/assert: ^1.11
Requires (Dev)
- api-platform/core: ^2.7.16
- babdev/pagerfanta-bundle: ^3.8
- behat/behat: ^3.14
- doctrine/doctrine-bundle: ^2.11
- jms/serializer-bundle: ^4.2
- lexik/jwt-authentication-bundle: ^2.17
- setono/sylius-plugin-pack: ~1.14.1
- sylius-labs/polyfill-symfony-security: ^1.1.2
- symfony/debug-bundle: ^5.4 || ^6.4 || ^7.0
- symfony/dotenv: ^5.4 || ^6.4 || ^7.0
- symfony/intl: ^5.4 || ^6.4 || ^7.0
- symfony/property-info: ^5.4 || ^6.4 || ^7.0
- symfony/web-profiler-bundle: ^5.4 || ^6.4 || ^7.0
- symfony/webpack-encore-bundle: ^1.17.2
- willdurand/negotiation: ^3.1
This package is auto-updated.
Last update: 2025-12-15 14:30:19 UTC
README
Use Plausible Analytics to track visitors and events in your Sylius store.
Installation
Step 1: Install and enable the plugin
composer require setono/sylius-plausible-plugin
Step 2: Add the Plausible script identifier trait to your Channel entity
<?php declare(strict_types=1); namespace App\Entity\Channel; use Doctrine\ORM\Mapping as ORM; use Setono\SyliusPlausiblePlugin\Model\ChannelInterface as PlausibleChannelInterface; use Setono\SyliusPlausiblePlugin\Model\ChannelPlausibleAwareTrait; use Sylius\Component\Core\Model\Channel as BaseChannel; #[ORM\Entity] #[ORM\Table(name: 'sylius_channel')] class Channel extends BaseChannel implements PlausibleChannelInterface { use ChannelPlausibleAwareTrait; }
Step 3: Update your database schema
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
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:
- Identifier only:
pa-hb0WlWkUb5U3qhSS-vd-a - Full URL:
https://plausible.io/js/pa-hb0WlWkUb5U3qhSS-vd-a.js - HTML snippet:
<script async src="https://plausible.io/js/pa-hb0WlWkUb5U3qhSS-vd-a.js"></script>
The plugin will normalize any of these formats and output the correct script tag on your storefront.