Skip to content

Commit

Permalink
Updated googleAnalytics.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Tsoganov authored and Sergei Tsoganov committed Dec 6, 2023
1 parent b6ea7f9 commit 1173e92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/googleAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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=/`;
Expand Down

0 comments on commit 1173e92

Please sign in to comment.