klaro-js icon indicating copy to clipboard operation
klaro-js copied to clipboard

Default setting for accepting a service

Open DanYouCan opened this issue 8 months ago • 0 comments

How can you ensure that a service is accepted first by default when a website is accessed for the first time? Without having to give consent first. For example, with an embedded IFrame for Google Maps. The contextual consent should also not (yet) be displayed.

The contextual consent should only appear after consent has been explicitly declined.

I should also add that for Switzerland, for a website that only applies to Switzerland, it is currently not necessary to obtain the user's consent.

I had no success with the following code:

{
name: 'googlemaps',
title: 'Google Maps',
purposes: ['functional'],

default: true,
// required: false,
optOut: true,

onAccept: `
	console.log('klaro-google-maps-accepted');
	document.querySelectorAll('.gmap-klaro').forEach(e => e.classList.replace('gmap-klaro', 'gmap'));
`,
onDecline: `
	console.log('klaro-google-maps-notaccepted');
	document.querySelectorAll('.gmap').forEach(e => e.classList.replace('gmap', 'gmap-klaro'));
`,
}

Is there anything else to consider? Thanks in advance for any help or hint.

DanYouCan avatar Jun 07 '24 15:06 DanYouCan