From 1173e9217a3a2bfb6d50c4b9a23c2d2d88493f38 Mon Sep 17 00:00:00 2001 From: Sergei Tsoganov Date: Wed, 6 Dec 2023 11:52:49 +0200 Subject: [PATCH] Updated googleAnalytics.js --- src/utils/googleAnalytics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/googleAnalytics.js b/src/utils/googleAnalytics.js index d9b075a..eb24895 100644 --- a/src/utils/googleAnalytics.js +++ b/src/utils/googleAnalytics.js @@ -71,9 +71,9 @@ const hasConsentForAnalytics = () => { }; const removeGACookies = () => { - const cookies = new Cookies().getAll(); // document.cookie.split(';'); + const cookies = new Cookies(); // document.cookie.split(';'); - Object.keys(cookies).forEach((cookie) => { + Object.keys(cookies.getAll()).forEach((cookie) => { const cookieName = cookie.split('=')[0].trim(); if (cookieName.match(/^(_ga|_gid|_gat|.+\._ga|.+\._gid|.+\._gat)$/)) { // document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;