klaro-org / klaro-js

Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
https://klaro.org
Other
1.18k stars 249 forks source link

Klaro is not showing if mustConsent: false #389

Open Socrapop opened 3 years ago

Socrapop commented 3 years ago

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

mbsouth commented 3 years ago

@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?

dadaxr commented 1 year ago

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 ;)

kanow commented 1 month ago

I have the same issue here today. If I set mustConsent to false I have an completely different consent modal. If I set this to true then I have another Modal. And then I also see my defined services from the config file!? Otherwise (with set mustConsent to false) the modal is empty. Just show the consent notice descrtiption. That looks not like a browser issue for me. I've tested this in chrome and firefox. No cookie handling extension ist active in my browser.

mustConsent: false image

mustConsent: true image

I'm using v 0.7.18 of klaro

kanow commented 1 month ago

Ah, I think that is no bug, it's a feature. It's only a misleading documentation isssue. I assumed that with this setting to true it's not possible to ignore that modal. But this is to configure either an "really consent modal" or an "only inform the user about cookies" modal. That means with false just an info modal will be shown and with true a cookie consent modal will be shown :-) That makes sense. Issue can be closed in my opinion.

mbsouth commented 1 month ago

... assumed that with this setting to true it's not possible to ignore that modal. But this is to configure either an "really consent modal" or an "only inform the user about cookies" modal.

Yes, that's exactly how it is: https://klaro.org/docs/integration/annotated-configuration

/*
    If 'mustConsent' is set to 'true', Klaro will directly display the consent
    manager modal and not allow the user to close it before having actively
    consented or declined the use of third-party services.
    */