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

Button "Always" on contextual consents is not saving the opt-in

Open fnvon opened this issue 3 years ago • 10 comments

Klaro Config

export const nvonKlaroConfig: KlaroConfig = {
  translations: {
    en: {
      privacyPolicyUrl: "/datenschutz",
      consentNotice: {
        description: "Dieser Text wird in der Einwilligungsbox erscheinen.",
      },
      consentModal: {
        description:
          "Hier können Sie einsehen und anpassen, welche Information wir über Sie " +
          'sammeln. Einträge die als "Beispiel" gekennzeichnet sind dienen lediglich ' +
          "zu Demonstrationszwecken und werden nicht wirklich verwendet.",
      },
      purposes: {
        analytics: {
          title: "Statistiken",
        },
        media: {
          title: "Mediendienste",
        },
      },
    },
  },
  services: [
    {
      name: "google-analytics",
      purposes: ["analytics"],
    },
    {
      name: "youtube-video",
      purposes: ["media"],
    },
  ],
};

HTML Code of Page

https://nvonv3-nvn945addcookieconsenttoolandg.gtsb.io/

Steps to reproduce

  1. open the link https://nvonv3-nvn945addcookieconsenttoolandg.gtsb.io/
  2. scroll to blocked youtube-video
  3. click "Always" button
  4. Reload the page
  5. YouTube iframe gets blocked again and has to be accepted by clicking "always" again even though the user gave his opt-in already.

Current behavior

  • clicking the "Always" button does the same thing as the "Yes" button. When the user opens the cookie, accepts the Media Cookies and saves his preferences, the opt-in gets saved and stays, even when he reloads the page. this does not work for the "Always" button in a contextual content.

Expected behavior

  • When you click the "Always" button, the opt-in should be saved for the future so when the user returns to the page later, he does not have to accept it again.

fnvon avatar Nov 09 '21 15:11 fnvon

This seems like an issue with the storage mechanism rather than Klaro. Can you check the contextual consent on our own website? There clicking on "Always" should save the consent decision and when you close and reopen the page the embedded map should load directly.

Maybe an extension is blocking the storage of Klaros' cookies/localStorage entries?

adewes avatar Nov 10 '21 10:11 adewes

Hi Andreas, thanks for your quick reply. I really appreciate that 🙂

I checked the behaviour on different browsers and devices. It stays the same. I also checked it on your website and I saw the same behaviour there.

Just to be clear: It does work, when clicking the sticky popup/overlay on the bottom right. It does NOT work, when clicking the "Always" button in the contextual placeholder.

I made a screencast for you, showing the behaviour on a clean firefox without any extensions. I hope that helps, recreating the issue:

https://nvonv3-nvn945addcookieconsenttoolandg.gtsb.io/klaro-contextual.mp4

Thanks again for your help!

fnvon avatar Nov 10 '21 11:11 fnvon

I just stumbled over this issue because one of my clients notified me about the same behaviour on his site (near to the second heading).

I checked it in different browsers, but "always" seems not to be saved in any browser. Also not the example on your website.

Thanks for your help in advance!

danielzellfelder avatar Nov 16 '21 16:11 danielzellfelder

I think the problem might be that the user didn't submit the main Klaro consent decision. Before doing that any contextual consent will also be temporary. Do you use Klaro exclusively for contextual consents? If yes that wasn't an option which we foresaw, we'll have to add a workaround for that.

adewes avatar Nov 16 '21 16:11 adewes

Hi Andreas, thank you for your quick reply! :)

Yes in this case I'm using Klaro only for contextual consents to avoid bothering the users with a main consent-modal. So it would be great if you could add a workaround for that.

Or is it possible to trigger the "main decision" behind the scenes to save the contextual consents? In a newer version of the site (currently only on my local webserver) I already use the "callback" function on each service. So if there is a way to trigger it from there, I would be fine ;-)

Thank you again for your help!

danielzellfelder avatar Nov 17 '21 07:11 danielzellfelder

Ok we'll get this fixed ASAP. In general you can use this workaround, i.e. just call klaro.getManager().saveAndApplyConsents() after loading Klaro, then the "Always" button should work. We'll fix the problem independently of this.

adewes avatar Nov 17 '21 11:11 adewes

Thank you very much! With your little workaround it now works like a charm ;-)

danielzellfelder avatar Nov 17 '21 11:11 danielzellfelder

Hi! I'm having the same problem. I have an external map on top of my website, so it might happen that a user clicks the "Always"-button before clicking anything "inside" the consent modal.

So klaro.getManager().saveAndApplyConsents() isn't really an option because first clicking the "Always"-Button makes the consent modal disappear - which is not good, because then the user would have hard times to find / open it again to review his/her choices!

(Also in this case klaro.getManager().saveAndApplyConsents() would save all other services to the pre-configured defaults without the user being able to deny / accept or making adjustments.)

In my eyes it should work like this:

  • user comes to the page - and sees the blocked external media AND the consent modal
  • user ignores the modal, but clicks "Always" to activate the external media
  • consent to external media should now be applied and stored / saved to the storage, but only for this service
  • the external media is now active, and stays active after reloading the page
  • at the same time the consent modal remains visible, until the user clicks some of the buttons in the modal

mockmeup avatar Jan 31 '22 22:01 mockmeup

Hi, any update on this issue? We're also seeing the same behaviour. If the user hasn't interacted with the consent popup yet, the Always button has the same behaviour as the Yes button, only storing the consent for the current page view. This is pretty unintuitive and should be fixed in the core in my opinion. Clicking Always should always store that setting in a persistent way, regardless of whether the user has interacted with the popup/modal.

Is there an ETA for this bugfix?

MoritzLost avatar Aug 24 '22 14:08 MoritzLost

could you please fix this, it's been a year thx

marcruecker avatar Oct 17 '22 09:10 marcruecker

@adewes could you check https://github.com/klaro-org/klaro-js/pull/465 and make a new release? Thx!

klauswagner avatar Mar 19 '24 14:03 klauswagner

Hey @klauswagner and everyone else, this is finally fixed with release 0.7.22!

adewes avatar Mar 26 '24 17:03 adewes