5

Our client is using cookiebot on their sites and we faced an issue that is happening when the user chooses "Only Necessary" cookies. This problem occurs only when the "Only Necessary" option is selected, and is not happening if all cookies are accepted.

We have noticed that after "Only Necessary" cookies are accepted, the subscribe on Angular HttpClient get(), post() and other methods is never executed. This problem is solved if the page is reloaded.

Here is a code example:

this.http.get<string[]>('some/api/users', httpOptions)
.subscribe(res => {
  // It never gets here
  this.users = res;
});

I have created a simple PoC application that is demonstrating this behavior, which can be accessed here: https://cookiebot-poc.herokuapp.com/mobapp/

Working scenario:

  1. Clean cookies (or open incognito)
  2. Open https://cookiebot-poc.herokuapp.com/mobapp/
  3. Accept "all" cookies
  4. Click "Do Get" or "Do Post" button
  5. Request is sent, and list with users are displayed on screen

Issue reproduction scenario:

  1. Clean cookies (or open incognito)
  2. Open https://cookiebot-poc.herokuapp.com/mobapp/
  3. Accept "Necessary" cookies only
  4. Click "Do Get" or "Do Post" button
  5. Nothing happens

What is going wrong here?

4
  • Is it an idea to open this as an issue on GitHub for Angular, or a support ticket with Cookiebot? Just to get more information directly from the people responsible Commented Sep 28, 2022 at 14:59
  • 1
    The library you are using is overriding the "addEventListener" method. I found that there is a problem with it. As a workaround, you can refresh the page after the user chooses the cookie. For the actual solution, you should contact the relevant company. Commented Oct 4, 2022 at 12:22
  • Thanks @MuhammetCanTONBUL , I've opened a support ticket with them to hopefully get some more information. Commented Oct 5, 2022 at 14:04
  • For the sake of making this question complete, I'll drop the cookiebot support page link (now deleted, archived link only). Fix is to remove data-blockingmode="auto" due to DOM control conflicts between Angular and Cookiebot. Commented Sep 10 at 9:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.