PHPackages                             3brs/sylius-analytics-plugin - 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. 3brs/sylius-analytics-plugin

ActiveSylius-plugin[Utility &amp; Helpers](/categories/utility)

3brs/sylius-analytics-plugin
============================

Analytics tracking plugin for Sylius front store and product views.

1.1.0(7mo ago)236[1 PRs](https://github.com/3BRS/sylius-analytics-plugin/pulls)MITPHPPHP ^8.2

Since Jul 17Pushed 7mo ago3 watchersCompare

[ Source](https://github.com/3BRS/sylius-analytics-plugin)[ Packagist](https://packagist.org/packages/3brs/sylius-analytics-plugin)[ RSS](/packages/3brs-sylius-analytics-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (73)Versions (5)Used By (0)

 [ ![](https://camo.githubusercontent.com/bb0c16caf210bea68e0e59fc11e0844dc47097f9aeb8b388c3de5f1414d4d1c0/68747470733a2f2f33627273312e667261312e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f336272732f6c6f676f2f334252532d6c6f676f2d73796c6975732d3230302e706e67) ](https://www.3brs.com)

Sylius Analytics Plugin
 [ ![](https://camo.githubusercontent.com/9b0b1c0a2aae2a2748d6a9cf2c25e1ee0d92ee837f851bfbc21d0205ce69e8b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f336272732f73796c6975732d616e616c79746963732d706c7567696e) ](https://packagist.org/packages/3brs/sylius-analytics-plugin "License") [ ![](https://camo.githubusercontent.com/d7f4f9d3acb8355e255b5bf7010d596b222fa6dc0780c5f44f117b2c46bdc6d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f336272732f73796c6975732d616e616c79746963732d706c7567696e) ](https://packagist.org/packages/3brs/sylius-analytics-plugin "Version") [ ![](https://camo.githubusercontent.com/75497ebf13a443ea5e2b8e8bd50a2999d96097828d5547cfb3659f9d027582c9/68747470733a2f2f636972636c6563692e636f6d2f67682f334252532f73796c6975732d616e616c79746963732d706c7567696e2e7376673f7374796c653d736869656c64) ](https://circleci.com/gh/3BRS/sylius-analytics-plugin "Build status")
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#sylius-analytics-plugin--------------------------------------------)

Features
--------

[](#features)

- Asynchronously logs visits to all frontend pages (excluding admin)
- Tracks visitor data: channel, full URL, route name, customer, session ID, IP address, user agent, and timestamp
- Displays:
    - Most requested pages in the last X days (configurable)
    - Request counts on product detail pages
    - Full log of requests with filtering capabilities inside the admin panel
- Built on top of Symfony Messenger for asynchronous processing

 [![](./doc/request-log-list.png)](./doc/request-log-list.png)

Installation
------------

[](#installation)

1. Run `composer require 3brs/sylius-analytics-plugin`.
2. Register plugin in your `config/bundles.php`

    ```
    ThreeBRS\SyliusAnalyticsPlugin\ThreeBRSSyliusAnalyticsPlugin::class => ['all' => true],
    ```
3. Import configuration to `config/packages/threebrs_sylius_analytics_plugin.yaml`:

    ```
    imports:
        - { resource: "@ThreeBRSSyliusAnalyticsPlugin/config/config.yaml" }
    ```
4. Import routing to `config/routes.yaml`:

    ```
    threebrs_statistics_plugin_routing_file:
        resource: "@ThreeBRSSyliusAnalyticsPlugin/config/routes.yaml"
        prefix: '%sylius_admin.path_name%'
    ```
5. ### Messenger Transport Configuration

    [](#messenger-transport-configuration)

    This plugin uses **Symfony Messenger** to log requests.

    #### Default Behavior (Synchronous)

    [](#default-behavior-synchronous)

    - By default, the plugin uses **synchronous processing** via the `sync://` DSN. This means that log messages are processed immediately, without requiring any queue or worker. This is ideal for development and testing environments.
    - To enable this mode, set the following in your `.env`:

    ```
    THREEBRS_MESSENGER_TRANSPORT_LOG_VISIT_DSN=sync://
    ```

    - For better performance in production or staging environments, you can configure the plugin to log requests asynchronously using a queue (e.g., Doctrine transport)

    ```
    THREEBRS_MESSENGER_TRANSPORT_LOG_VISIT_DSN=doctrine://default
    ```

    - After setting this, you must run the Messenger worker to process the queued log messages:

    ```
    bin/console messenger:consume log_visit -vv
    ```

    - Only use this mode if your project supports background workers and a transport like Doctrine, Redis, etc.
6. Configure how many past days are considered when calculating the **"Most Visited Pages"** in the admin dashboard by setting the following parameter:

    ```
    parameters:
        threebrs_analytics_plugin.request_log_days: 7 # Change as needed
    ```
7. Generate and run Doctrine migrations:

    ```
    bin/console doctrine:migrations:diff
    bin/console doctrine:migrations:migrate
    ```
8. Optional: Enable UTF-8 support in routing for better slug handling (diacritics, etc.):

    ```
    # config/packages/routing.yaml
    framework:
        router:
            utf8: true
    ```

Usage
-----

[](#usage)

The plugin will automatically log requests on:

- Homepage
- Product detail pages
- Category pages
- Cart pages
- Other shop pages

You can view the statistics inside the admin panel under the Analytics section.
Log processing is handled via Symfony Messenger, either synchronously (by default) or asynchronously if a queue is configured.

Development
-----------

[](#development)

### Setup

[](#setup)

Initialize the development environment:

```
make init
```

This command installs dependencies, sets up the database, and prepares frontend assets (or follow related steps in Makefile).

### Usage

[](#usage-1)

- Develop your plugin logic inside `/src`
- See `bin/` for useful dev tools

### Testing

[](#testing)

Run all tests and quality checks:

```
make ci
```

Run individual checks:

```
make phpstan    # Static analysis
make ecs        # Code style check
make fix        # Fix code style issues
make lint       # Symfony and Doctrine linting
make behat      # Behavioral tests
```

### Database Management

[](#database-management)

```
make fixtures       # Load test fixtures
```

### Development Server

[](#development-server)

Start the development environment:

```
make run           # Start Docker containers
make bash          # Access PHP container shell
```

### Other Useful Commands

[](#other-useful-commands)

```
make static        # Run static analysis (PHPStan + ECS + Lint)
make cache         # Clear application cache
make var           # Recreate var directory
```

All commands use the test environment by default. See the Makefile for detailed implementation of each target.

License
-------

[](#license)

This library is under the MIT license.

Credits
-------

[](#credits)

Developed by [3BRS](https://3brs.com)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance64

Regular maintenance activity

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab23998c28b111996e4b3357f20929d6904a97ac21724750e1dfafd6a09791e4?d=identicon)[ondrej-kuhnel](/maintainers/ondrej-kuhnel)

---

Top Contributors

[![jaroslavtyc](https://avatars.githubusercontent.com/u/2290225?v=4)](https://github.com/jaroslavtyc "jaroslavtyc (5 commits)")[![AdhamKandeel27](https://avatars.githubusercontent.com/u/108978262?v=4)](https://github.com/AdhamKandeel27 "AdhamKandeel27 (2 commits)")[![ondrej-kuhnel](https://avatars.githubusercontent.com/u/6840281?v=4)](https://github.com/ondrej-kuhnel "ondrej-kuhnel (1 commits)")

---

Tags

syliussylius-plugin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/3brs-sylius-analytics-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/3brs-sylius-analytics-plugin/health.svg)](https://phpackages.com/packages/3brs-sylius-analytics-plugin)
```

###  Alternatives

[sylius/refund-plugin

Plugin provides basic refunds functionality for Sylius application.

691.7M14](/packages/sylius-refund-plugin)[stefandoorn/sitemap-plugin

Sitemap Plugin for Sylius

851.0M](/packages/stefandoorn-sitemap-plugin)[monsieurbiz/sylius-rich-editor-plugin

A Rich Editor plugin for Sylius.

75380.8k6](/packages/monsieurbiz-sylius-rich-editor-plugin)[synolia/sylius-scheduler-command-plugin

Scheduler Command Plugin.

34361.5k](/packages/synolia-sylius-scheduler-command-plugin)[odiseoteam/sylius-blog-plugin

This plugin add blog capabilities to your Sylius project

37104.5k](/packages/odiseoteam-sylius-blog-plugin)[webgriffe/sylius-table-rate-shipping-plugin

Provides table rate shipping calculator.

1490.4k](/packages/webgriffe-sylius-table-rate-shipping-plugin)

PHPackages © 2026

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