klaro-js
klaro-js copied to clipboard
Klaro is not showing if mustConsent: false
Hello!
I can't get Klaro to work properly when mustConsent: false.
I don't want to show the manager modal first, but when mustConsent is set to false nothing happens.
I'm loading it as described in your website documentation https://heyklaro.com/docs/getting-started
Here is my code :
<script>
var klaroConfig = {
version: 1,
htmlTexts: true,
styling: {
theme: ['dark', 'bottom', 'wide'],
},
noAutoLoad: false,
groupByPurpose: true,
storageMethod: 'cookie',
cookieName: 'CookieConsentDE',
cookieExpiresAfterDays: 365,
mustConsent: false,
acceptAll: true,
hideDeclineAll: false,
hideLearnMore: false,
noticeAsModal: false,
additionalClass: 'cookienotice-de',
translations: {
zz: {
privacyPolicyUrl: '/#privacy',
},
fr: {
googleAnalytics: {
title: "Google Analytics",
description: "Test",
},
purposes: {
analytics: "Analytics",
styling: "Styling",
}
}
},
services: [
//All my services, removed here for clarity
]
};
</script>
<script defer type="application/javascript" src="https://cdn.kiprotect.com/klaro/v0.7.18/klaro.js" data-config="klaroConfig"></script>
On the readme, it's written that "By default, Klaro will automatically open once the page is fully loaded" but it's not in my case. I have no error in my console.
Also, on a side note, the annoted config file is not the same on this repo and on your website so I'm a little lost, a list of all available parameters with all available values (as an example, what can be added on the styling parameter?) would be great :)
Thank you for your time ! Camille
@Socrapop I copied your configuration and used my own service config part: Klaro works as expected for me! Maybe a bug in your service settings?
I know this issue is quite old but... I was having the same issue and it took me a while to find the origin : I'm using brave browser which include an option to auto hide some cookie notices... https://brave.com/privacy-updates/21-blocking-cookie-notices/
=> I'm sure brave is not the only one to provide that kind of feature (some third party browser extension should too) so maybe have a look in that direction ;)