Remove Plausible analytics (migrated to OpenPanel)

This commit is contained in:
victormanuel.caverogracia 2026-07-26 20:39:26 +02:00
parent f0ecb0d078
commit 28a1f6aef2
2 changed files with 12 additions and 15 deletions

View file

@ -190,8 +190,6 @@
</script> </script>
<!-- Analytics --> <!-- Analytics -->
<script defer data-domain="openshorts.app" src="https://analytics.fotoexamen.com/js/script.js"></script>
<script>window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<!-- OpenPanel analytics (self-hosted) --> <!-- OpenPanel analytics (self-hosted) -->
<script> <script>
window.op = window.op || function () { var n = []; return new Proxy(function () { arguments.length && n.push([].slice.call(arguments)); }, { get: function (t, r) { return "q" === r ? n : function () { n.push([r].concat([].slice.call(arguments))); }; }, has: function (t, r) { return "q" === r; } }); }(); window.op = window.op || function () { var n = []; return new Proxy(function () { arguments.length && n.push([].slice.call(arguments)); }, { get: function (t, r) { return "q" === r ? n : function () { n.push([r].concat([].slice.call(arguments))); }; }, has: function (t, r) { return "q" === r; } }); }();

View file

@ -1,20 +1,19 @@
// Lightweight Plausible custom-event helper. // Lightweight custom-event helper (OpenPanel).
// //
// The hosted openshorts.app build loads the Plausible script (see index.html), // The hosted openshorts.app build loads OpenPanel (see index.html), which
// which exposes `window.plausible`. Self-hosted builds, ad-blockers or offline // exposes `window.op`. Self-hosted builds, ad-blockers or offline dev simply
// dev simply won't have it — every call here is a safe no-op in that case, so // won't have it — every call here is a safe no-op in that case, so analytics
// analytics can never break the app or leak into the open-source experience. // can never break the app or leak into the open-source experience.
// //
// This targets a Plausible Community Edition instance, which has NO revenue // Events (name — meaning):
// goals (that's a Cloud-only feature) — so prices ride along as ordinary props // - Signup — account created / signed in
// (e.g. value_usd) that CE can break a goal down by. Goals to create (by name): // - CheckoutStarted — redirected to Stripe Checkout
// - Signup (custom event) — account created / signed in // - Subscribed — plan activated after checkout
// - CheckoutStarted (custom event) — redirected to Stripe Checkout // Prices ride along as ordinary props (e.g. value_usd) for breakdowns.
// - Subscribed (custom event) — plan activated after checkout
export function track(event, options) { export function track(event, options) {
try { try {
if (typeof window !== 'undefined' && typeof window.plausible === 'function') { if (typeof window !== 'undefined' && typeof window.op === 'function') {
window.plausible(event, options); window.op('track', event, (options && options.props) || {});
} }
} catch (_) { } catch (_) {
/* analytics must never throw into the app */ /* analytics must never throw into the app */