Skip to content

Commit

Permalink
Merge pull request #313 from City-of-Helsinki/matomo-fix
Browse files Browse the repository at this point in the history
fix: matomo cookie
  • Loading branch information
jannetalvio committed Dec 4, 2023
2 parents 4a8d11c + ca67548 commit 0f5432e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hkm/static/hkm/js/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
_paq.push(["requireConsent"]);

// if rejected
if (cookie && cookie === 0) {
if (cookie && cookie === "0") {
_paq.push(["forgetCookieConsentGiven"]);
_paq.push(["forgetConsentGiven"]);
}

// if accepted
if (cookie && cookie === 1) {
if (cookie && cookie === "1") {
_paq.push(["rememberConsentGiven"]);
_paq.push(["rememberCookieConsentGiven"]);
}
Expand All @@ -45,7 +45,7 @@
if (_paq) {
_paq.push(["rememberConsentGiven"]);
_paq.push(["rememberCookieConsentGiven"]);
$.cookie(cookieName, 1, { expires: 393 });
$.cookie(cookieName, "1", { expires: 393 });
$cookieConsentContainer.fadeOut();
}
});
Expand All @@ -54,7 +54,7 @@
if (_paq) {
_paq.push(["forgetConsentGiven"]);
_paq.push(["forgetCookieConsentGiven"]);
$.cookie(cookieName, 0, { expires: 393 });
$.cookie(cookieName, "0", { expires: 393 });
$cookieConsentContainer.fadeOut();
}
});
Expand Down

0 comments on commit 0f5432e

Please sign in to comment.