setono/sylius-plausible-plugin

Setono example plugin for Sylius.

Fund package maintenance!
Setono

Installs: 1 025

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:sylius-plugin

v0.2.1 2023-12-19 10:40 UTC

This package is auto-updated.

Last update: 2024-04-19 11:31:54 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"