Skip to content

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

License

Notifications You must be signed in to change notification settings

Setono/sylius-plausible-plugin

Repository files navigation

Sylius plugin integrating Plausible Analytics

Latest Version Software License Build Status Code Coverage Mutation testing

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

Installation

Step 1: Install and enable plugin

composer require setono/sylius-plausible-plugin

Usage

If you have created your website in the Plausible dashboard, the plugin will just work out of the box. Enjoy 🎉

Configuration

Add functionality

Plausible use different scripts to enable functionality. Plausible calls them script extensions, and you can read about them here.

To use a script extension, you need configure the script in the plugin as follows:

setono_sylius_plausible:
    client_side:
        script: "https://plausible.io/js/script.manual.revenue.file-downloads.js"

Here I have added the 'file downloads' extension. Notice that I am keeping both the 'manual' and 'revenue' extensions. This is because the 'revenue' extension is used for tracking purchases, and the 'manual' extension is used for manual tracking of the pageview event.

Test tracking

If you want to test the plugin in your local environment, you can input the domain and use the local script extension:

setono_sylius_plausible:
    client_side:
        script: "https://plausible.io/js/script.manual.revenue.local.js"
    domain: "your-domain.com"