Skip to main content

Cookiebot is breaking angular Angular HttpClient subscribe



  • Pavel Hruschka


    any news on this issue?

    I have the same issue, subscribe is not raised after successful HTTP request (it returns HTTP status 200 + data, the only cookie in this request is Cookiebot cookie, but subscribe fnc is not raised with any error message).

    I use Angular 11.

    I don't use any cookies.

    In my case I have to allow all cookies - when some of cookies are disabled then subscribe fnc is not raised.

    In addition, Cookiebot settings can not be changed when some cookies are disabled (I call Cookiebot.renew() method, but it does nothing, user has to reload page (F5) and then can change Cookiebot settings or it does work without F5 when all cookies are enabled).

    Thank you.


  • dimeali1821142

    Our client is using a cookie bot on his sites, and we faced an issue when the user accepts only "Necessary" cookies. This problem occurs only when the "Necessary" option is selected and is not happening if all cookies are accepted.

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

  • Manfred msc austria


    <script type="text/javascript">
      function CookiebotCallback_OnLoad() {
        Cookiebot.changed && document.location.reload();
  • Pavel Hruschka


    I solved this by removing data-blockingmode="auto" from Cookiebot-init script in index.html

    This is the answer from Cookiebot support:

    Angular app brokes when Automatic Blocking Mode is enabled, which we highly advocate against, when using the Angular framework.

    The reason for the above is that our auto blocker takes control of the Document Object Model (DOM), when matching the objects listed in configuration.js - the file we use to withhold/block scripts before the user has given consent. Now, Angular also needs to have control over the DOM to function properly, so, by enabling our auto blocker you have a clear conflict at hand here.

    On the opposite, Manual Blocking Mode does not utilize the DOM, thus the Angular is allowed to function without issues (hopefully).



Please sign in to leave a comment.