Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems to show the window on start #534

Open
janstieler opened this issue Jan 28, 2025 · 1 comment
Open

Problems to show the window on start #534

janstieler opened this issue Jan 28, 2025 · 1 comment

Comments

@janstieler
Copy link

Hello,

I integrate the klaro cookie consent through nodemodules in my website and also the config file.
But I don't understand why it is loading directly with the class cookie-notice-hiddenadded.

This is my config file:

var klaroConfig = {
    version: 2,
    cookieName: 'klaro',
    elementID: 'klaro',
    lang: 'de',
    noNotice: true,
    poweredBy: '',
    storageMethod: 'cookie',
    testing: false,
    translations: {
        de: {
            privacyPolicyUrl: 'https://www.kdjfs.de/langerecht/datenschutz',
            consentModal: {
                title: 'Wir brauchen Ihre Zustimmung',
                description: 'Wir benötigen Ihre Zustimmung zur Verwendung von Cookies. ',
            },
            klaro: {
                description: 'Wir setzen einen Cookie, um den Zustand der getroffenen Auswahl im Cookie-Banner zu speichern.',
            },
            googlemaps: {
                description: 'Darstellung von Karten',
            },
            purposes: {
                essenziell: 'Essenziell',
                analytics: 'Statistiken',
                externalmedia: 'Drittanbieter Plugins'
            },
        },
    },

    // This is a list of third-party services that Klaro will manage for you.
    services: [
        {
            name: 'klaro',
            title: "Technisch notwendiges Cookies",
            required: true,
            purposes: ['essenziell'],
            cookies: ['klaro', 'PHPSESSID'],
        },
        {
            name: 'googlemaps',
            default: false,
            title: 'Google Maps',
            purposes: ['externalmedia'],
            required: false,
            optOut: false,
            onlyOnce: true,
        },
    ],
};

And so I integrate it:

<script src="./assets/js/klaro.config.js"></script>
<script defer data-klaro-config="klaroConfig" type="application/javascript" src="./node_modules/klaro/dist/klaro.js"></script>

And can it be that the manual is for version 1?

Best

@MelchnerRoman
Copy link
Contributor

@janstieler add

mustConsent: true,

to config. This should show the box imidiately.

https://codesandbox.io/p/live/72f29570-86ce-4102-af30-35dd54c2feed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants