From ce3deb934783ad68e60b14965b6663ae09f0f673 Mon Sep 17 00:00:00 2001 From: Xavier Desoindre Date: Tue, 10 Dec 2024 18:37:06 +0100 Subject: [PATCH] fix: tracking matomo --- src/utils/matomo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/matomo.ts b/src/utils/matomo.ts index 0d557c006..0cac683c7 100644 --- a/src/utils/matomo.ts +++ b/src/utils/matomo.ts @@ -1,7 +1,7 @@ export const track = (category: string, action: string, name: string, ignoreReferrer?: boolean) => { if (window && window.please) { const url = - document.location.ancestorOrigins.length > 0 + document.location.ancestorOrigins && document.location.ancestorOrigins.length > 0 ? document.location.ancestorOrigins[0] : document.location?.origin || document.referrer if (!ignoreReferrer && url && !url.startsWith('https://impactco2.fr')) {