https://github.com/pixel-open/prestashop-plausible
Add Plausible Analytics in Prestashop.
https://github.com/pixel-open/prestashop-plausible
plausible plausible-analytics prestashop prestashop-module
Last synced: 8 months ago
JSON representation
Add Plausible Analytics in Prestashop.
- Host: GitHub
- URL: https://github.com/pixel-open/prestashop-plausible
- Owner: Pixel-Open
- License: mit
- Created: 2023-01-17T16:44:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T15:57:21.000Z (almost 2 years ago)
- Last Synced: 2025-04-06T20:36:14.622Z (about 1 year ago)
- Topics: plausible, plausible-analytics, prestashop, prestashop-module
- Language: PHP
- Homepage:
- Size: 90.8 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Prestashop Plausible
[](https://php.net/)
[](https://www.prestashop.com)
[](https://github.com/Pixel-Open/prestashop-plausible/releases)
## Presentation
Add Plausible Analytics in Prestashop.

## Requirements
- Prestashop >= 1.7.6.0
- PHP >= 7.2.0
## Installation
Download the **pixel_plausible.zip** file from the [last release](https://github.com/Pixel-Open/prestashop-plausible/releases/latest) assets.
### Admin
Go to the admin module catalog section and click **Upload a module**. Select the downloaded zip file.
### Manually
Move the downloaded file in the Prestashop **modules** directory and unzip the archive. Go to the admin module catalog section and search for "Plausible".
## Configuration
From the module manager, find the module and click on configure.
| Field | Description | Example | Required |
|:-----------------------|:------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------|
| Add JavaScript snippet | Enable stats by including the Plausible snippet in the head of your website | Yes | Y |
| Plausible Instance URL | Your plausible instance URL. Allow to use a custom domain for dedicated instance | https://plausible.io | N |
| Shared Link | The shared link allows to display stats in the "Statistics > Plausible" menu | https://plausible.io/share/website.prestashop?auth=xxxxx | N |
| Enable goals | Enable goal events: contact, cart, checkout-step-X, order, category, product | Yes | Y |
| Revenue Tracking | Enable Revenue Tracking (Plausible business plan only). Revenue is sent with the order goal. | Yes | Y |
| Contact goal name | Plausible goal name when customer send a contact message. Leave empty to ignore. | contact | N |
| Cart goal name | Plausible goal name when customer goes to the cart. Leave empty to ignore. | cart | N |
| Checkout goal name | Plausible goal name prefix when customer goes to a checkout step {goalName}-X. Leave empty to ignore. | checkout-step | N |
| Order goal name | Plausible goal name when customer submits order. Leave empty to ignore | order | N |
Create the **shared link** in your Plausible settings for the site in *Visibility > Shared links > + New link*
## Stats
In the Prestashop admin, the Plausible stats are available in the *Statistics > Plausible* menu.
## Goals
The module includes goal events when enabled in module configuration.
- Category page view
- Product page view
- Contact message sent
- Account registration
- Cart view
- Checkout step X
- Order complete
You need to add goal events in your Plausible website configuration:

The Plausible goal name must be the same as the name in the Prestashop module configuration.
Default goal names are:
- category
- product
- contact
- register
- cart
- checkout-step-1
- checkout-step-2
- checkout-step-3
- checkout-step-4
- order
### Revenue Tracking
With the goal "order", the "revenue tracking" can be sent ("Revenue Tracking" option in module configuration). **This feature is only available with Plausible business plan.**
When you add the "order" goal, you need to enable the "Revenue Tracking":

### How to add a custom goal?
In any template or JS file, use the `plausible` method to send the event to Plausible. Example:
```html
const myButton = document.getElementById('my-form-button');
if (myButton) {
myButton.addEventListener('click', function() {
plausible('my-form-button'); // "my-form-button" is the Plausible goal event name
});
}
```