1. Go to this page and download the library: Download akibeo/kirby-umami library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
akibeo / kirby-umami example snippets
return [
'akibeo.umami' => [
'enabled' => true,
'websiteId' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'src' => 'https://stats.example.com/script.js', // default: https://cloud.umami.is/script.js
// Tracker options, see https://umami.is/docs/tracker-configuration
'hostUrl' => null, // origin of the Umami instance; defaults to the origin of `src`
'autoTrack' => true, // false: only events you send with umami.track() in JS
'domains' => [], // only track on these hostnames
'tag' => null, // tag every view, to filter in the dashboard
'excludeSearch' => false, // drop ?query from tracked URLs
'excludeHash' => false, // drop #hash from tracked URLs
'trackInDebug' => false, // also track while option('debug') is true
'trackPanelUsers' => true, // false: skip logged-in Panel users (see note)
'nonce' => null, // CSP nonce; defaults to cspNonce() when akibeo/kirby-csp is installed
// Umami API, for the Panel view and umami()->stats()
'apiUrl' => null, // defaults to https://api.umami.is/v1 (cloud) or {hostUrl}/api
'apiKey' => null, // API key (Umami Cloud, or Settings > API keys on self-hosted)
'username' => null, // or the login of a self-hosted install
'password' => null,
'timeout' => 5, // seconds, for every request to Umami
// Panel
'panel' => true, // false: hide the "Analytics" menu entry
'shareUrl' => null, // public share URL, embedded in the Panel view
'cache' => true, // cache for API tokens and stats
],
];
'akibeo.umami' => [
'trackInDebug' => true, // test the tracker locally
],