Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

fix(plausible): adjust url pattern for 404 routes (#95)

Corentin THOMASSET0c811e3fc4bc
diff --git a/apps/papra-client/src/modules/plausible/components/plausible-tracker.component.tsx b/apps/papra-client/src/modules/plausible/components/plausible-tracker.component.tsx
index e55dbacd..0e2a408f 100644
--- a/apps/papra-client/src/modules/plausible/components/plausible-tracker.component.tsx
+++ b/apps/papra-client/src/modules/plausible/components/plausible-tracker.component.tsx
@@ -20,7 +20,9 @@ export const PlausibleTracker: Component = () => {
const matches = useCurrentMatches();
createEffect(() => {
- const pattern = matches().at(-1)?.route.pattern ?? '/';
+ const basePattern = matches().at(-1)?.route.pattern ?? '/';
+ const pattern = basePattern === '*404' ? window.location.pathname : basePattern;
+
const url = buildUrl({
path: pattern,
baseUrl: window.location.origin,