Wruczek / Bootstrap-Cookie-Alert

A simple, good looking cookie alert built for Bootstrap 3/4. No dependencies required.
https://wruczek.github.io/Bootstrap-Cookie-Alert/demo-bs5.html
MIT License
237 stars 51 forks source link

Can we get a callback ? #10

Closed ZARk-be closed 4 years ago

ZARk-be commented 4 years ago

Can we get a callback function ?

Technically, we are supposed to not use ANY cookies until the user has given consent. Therefore i need to know when the user clicked on AGREE to load Analytics and other tracking cookies.

derek-baker commented 4 years ago

@ZARk-be Couldn't you just add a click listener to the markup?

Wruczek commented 4 years ago

Added in 1.2.0

window.addEventListener("cookieAlertAccept", function() {
    alert("cookies accepted")
})