setono/sylius-plausible-plugin

Start tracking your visitors with Plausible.io

Fund package maintenance!
Setono

Installs: 3 125

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:sylius-plugin

v0.3.0 2024-08-27 07:47 UTC

This package is auto-updated.

Last update: 2024-10-27 08:09:50 UTC


README

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"