Fix cookie consent script missing (#1292)

This commit is contained in:
Andres Morales 2024-10-17 09:44:14 -06:00 committed by GitHub
parent ce5b1207e0
commit fc502ee029
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,18 @@
function onConsentChanged(categoryPreferences) {
console.log("onConsentChanged", categoryPreferences);
}
cb = document.createElement("div");
cb.id = "cookie-banner";
document.body.insertBefore(cb, document.body.children[0]);
window.WcpConsent && WcpConsent.init("en-US", "cookie-banner", function (err, consent) {
if (!err) {
console.log("consent: ", consent);
window.manageConsent = () => consent.manageConsent();
siteConsent = consent;
} else {
console.log("Error initializing WcpConsent: "+ err);
}
}, onConsentChanged, WcpConsent.themes.light);