/kirby-plausible

Simple Kirby CMS plugin for Plausible analytics.

Primary LanguagePHP

Kirby Plausible

Simple plugin providing plausible iframe panel view to kirby panel and simple frontend snippet.

CleanShot 2021-11-04 at 17 53 43

Instalation

composer require floriankarsten/kirby-plausible or download from releases

How to use

  1. Create a shared link https://plausible.io/docs/shared-links
  2. Set floriankarsten.plausible.sharedLink in config.php

There is also floriankarsten.plausible.domain which allows you to overwrite data-domain in the frontend snippet.

config.php example

'floriankarsten.plausible' => [
	'sharedLink' => 'https://plausible.io/share/yourwebsiteurl.com?auth=Jz0mCWTPu5opXi0sAgRrq',
	'domain' => 'test.com' // not required if not set it will be taken from $site->url
];

Frontend snippet place iside head tag. Automatically disabled when kirby is in debug mode.

<?php snippet('plausible'); ?>

This plugin wouldn't happen without @garethworld who kindly hired me to make it and then wanted to have it released to Kirby community. Yaaaaay