Plausible Analytics
Plausible Analytics is a simple, and privacy-friendly Google Analytics Alternative.
Configuration
Start by setting up the config for the destination. Destinations can be used via node or directly in the browser.
const config = {
custom: {
domain: 'elbwalker.com', // Optional, domain of your site as registered
},
};
Custom
Property | Type | Description |
---|---|---|
domain | string | The domain of your site as registered in Plausible |
How to use
Define the configuration for your Plausible Analytics destination:
const config = {
custom: {
domain: 'yourdomain.com',
},
};
Choose one of the following installation options to use the destination:
- TypeScript
- Script
- Code
Install the destination via npm
npm i @elbwalker/destination-web-plausible
import { elb } from '@elbwalker/walker.js';
import destinationPlausible from '@elbwalker/destination-web-plausible';
elb('walker destination', destinationPlausible, config);
Loading the destination via dynamic import
<script>
// Upload the dist/index.mjs on your own server
const destination = (
await import(
'https://cdn.jsdelivr.net/npm/@elbwalker/destination-web-plausible/dist/index.mjs'
)
).default;
elb('walker destination', destination, config);
</script>
Copy the code from the index.browser.js file
(function () {
'use strict';
var Destination = (() => {})(); // This is the copied code
elb('walker destination', Destination.default, config);
})();