parent
1be6b82419
commit
0e5c12ba90
@ -1,10 +1,18 @@ |
||||
trackingStatus: |
||||
other: Tracking Status |
||||
cookieConsentStatus: |
||||
other: Cookie Consent Status |
||||
|
||||
dismissPopup: |
||||
other: Dismiss |
||||
popupMsg: |
||||
other: By visiting my website, you agree with my |
||||
cookiePolicy: |
||||
other: cookie policy |
||||
|
||||
cookieConsentStatus: |
||||
other: Cookie Consent Status |
||||
cookieConsentText: |
||||
other: This site uses cookies to track its usage. A detailed description of the Matomo cookies used, and what they purpose is, could be found |
||||
cookieConsentHere: |
||||
other: here |
||||
cookieConsentTrack: |
||||
other: Bare in mind that even if you allow cookies but have your browser set to "Do not track", you won't be tracked. |
@ -0,0 +1,45 @@ |
||||
function shouldShowPopup() { |
||||
dismissed = localStorage.getItem('popupDismissed'); |
||||
|
||||
banner = document.getElementsByClassName("cookie-banner")[0]; |
||||
if (dismissed == null || dismissed === "no") { |
||||
banner.style.display = 'block'; |
||||
} |
||||
} |
||||
|
||||
function dismissPopup() { |
||||
localStorage.setItem('popupDismissed', 'yes'); |
||||
banner = document.getElementsByClassName("cookie-banner")[0]; |
||||
banner.style.display = 'none'; |
||||
} |
||||
|
||||
function updateCookieConsent() { |
||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId); |
||||
when = t.getRememberedCookieConsent(); |
||||
|
||||
button = document.getElementById("cookiesaction"); |
||||
text = button.parentNode.getElementsByTagName('span')[0] |
||||
if (when == 0) { |
||||
text.innerHTML = "You haven't allowed cookies to be used" |
||||
button.innerHTML = "Allow" |
||||
button.style.visibility = "" |
||||
button.onclick = function() { startCookieConsent(); } |
||||
} else { |
||||
text.innerHTML = "Using cookies to track your usage of the site" |
||||
button.innerHTML = "Stop" |
||||
button.style.visibility = "" |
||||
button.onclick = function() { stopCookieConsent(); } |
||||
} |
||||
} |
||||
|
||||
function stopCookieConsent() { |
||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId); |
||||
t.forgetCookieConsentGiven(); |
||||
updateCookieConsent(); |
||||
} |
||||
|
||||
function startCookieConsent() { |
||||
t=Matomo.getTracker(matomoHostURL, matomoSiteId); |
||||
t.rememberCookieConsentGiven(); |
||||
updateCookieConsent(); |
||||
} |
Loading…
Reference in new issue