Fix cookie usage detection
This commit is contained in:
parent
0e5c12ba90
commit
881671fbfe
1 changed files with 4 additions and 5 deletions
|
@ -14,12 +14,11 @@ function dismissPopup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCookieConsent() {
|
function updateCookieConsent() {
|
||||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId);
|
t=Matomo.getAsyncTracker();
|
||||||
when = t.getRememberedCookieConsent();
|
|
||||||
|
|
||||||
button = document.getElementById("cookiesaction");
|
button = document.getElementById("cookiesaction");
|
||||||
text = button.parentNode.getElementsByTagName('span')[0]
|
text = button.parentNode.getElementsByTagName('span')[0]
|
||||||
if (when == 0) {
|
if (!t.areCookiesEnabled()) {
|
||||||
text.innerHTML = "You haven't allowed cookies to be used"
|
text.innerHTML = "You haven't allowed cookies to be used"
|
||||||
button.innerHTML = "Allow"
|
button.innerHTML = "Allow"
|
||||||
button.style.visibility = ""
|
button.style.visibility = ""
|
||||||
|
@ -33,13 +32,13 @@ function updateCookieConsent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopCookieConsent() {
|
function stopCookieConsent() {
|
||||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId);
|
t=Matomo.getAsyncTracker();
|
||||||
t.forgetCookieConsentGiven();
|
t.forgetCookieConsentGiven();
|
||||||
updateCookieConsent();
|
updateCookieConsent();
|
||||||
}
|
}
|
||||||
|
|
||||||
function startCookieConsent() {
|
function startCookieConsent() {
|
||||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId);
|
t=Matomo.getAsyncTracker();
|
||||||
t.rememberCookieConsentGiven();
|
t.rememberCookieConsentGiven();
|
||||||
updateCookieConsent();
|
updateCookieConsent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue