Written in PHP for Shared-Hosting on Apache.
- Manually download the latest release from here.
- Move
.htaccess
,index.php
andoptions.php
into the root of your domain or subdomain (e.g.stats.example.com
). - Optional Customize the
options.php
. - Add the script like in the following example and customize the attributes.
<script defer data-domain="example.com" src="//stats.example.com/js/script.js"></script>
- Move
.htaccess
,index.php
andoptions.php
into the subfolder of your website (e.g.example.com/stats
). - Optional Customize the
options.php
. - Add the script like in the following example and customize the attributes.
<script defer data-domain="example.com" data-api="/stats/api/event" src="/stats/js/script.js"></script>
// Set the relative URI when the reverse proxy is running in a folder.
// If your proxy runs under https://example.com/stats, then set /stats as relative URI and otherwise just leave it blank.
$relativeUri = '/stats';
// Set all allowed URI which should be accessible trough the proxy
$whitelist = [
'/js/script.js',
'/api/event'
];
// Optional, map allowed URI to another for sanitizing any proofs of Plausible Analytics in the URI
$mapping = [
'/js/script.js' => '/js/plausible.outbound-links.js'
];
// Set URL of Plausible Analytics
$backendUrl = "https://plausible.io";
- Jonathan Nessier, Neoflow
If you would like to see this reverse proxy for Plausible Analytics develop further, or if you want to support me or show me your appreciation, please donate any amount through PayPal. Thank you! 🍻
Licensed under MIT.
Made in Switzerland with 🧀 and ❤️