Giter Site home page Giter Site logo

pixel-open / prestashop-plausible Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 73 KB

Add Plausible Analytics in Prestashop.

License: MIT License

PHP 92.16% CSS 0.11% JavaScript 3.20% Twig 2.83% Smarty 1.70%
plausible plausible-analytics prestashop prestashop-module

prestashop-plausible's Introduction

Prestashop Plausible

Minimum PHP Version Minimum Prestashop Version GitHub release

Presentation

Add Plausible Analytics in Prestashop.

Screenshot

Requirements

  • Prestashop >= 1.7.6.0
  • PHP >= 7.2.0

Installation

Download the pixel_plausible.zip file from the last release 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 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.

  • Contact message sent
  • Account registration
  • Cart view
  • Checkout step X
  • Order complete

You need to add goal events in your Plausible website configuration:

Plausible Goals

The Plausible goal name must be the same as the name in the Prestashop module configuration.

Default goal names are:

  • contact
  • register
  • cart
  • checkout-step-1
  • checkout-step-2
  • checkout-step-3
  • checkout-step-4
  • order

How to add a custom goal?

In any template or JS file, use the plausible method to send the event to Plausible. Example:

<input type="button" value="My Button" id="my-form-button" />

<script type="text/javascript">
    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
        });
    }
</script>

prestashop-plausible's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

atmaniak

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.