klaro-org / klaro-js

Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
https://klaro.org
Other
1.2k stars 255 forks source link

Hubspot tracking code - cookie consent banner show up after accepting cookies #451

Open trompx opened 2 years ago

trompx commented 2 years ago

Klaro Config

var klaroConfig = {
        apps: [
          {
            name: "google-analytics",
            default: true,
            title: "Google Analytics",
            purposes: ["analytics"],
            cookies: [/^ga/i]
          },
          {
            name: "hubspot",
            title: "Hubspot",
            purposes: ["marketing"],
            default: true,
          }
        ]

HTML Code of Page

    <script defer type="application/javascript" src="https://cdn.kiprotect.com/klaro/latest/klaro.js"></script>
    <script
      type="text/plain"
      data-type="text/javascript"
      id="hs-script-loader"
      data-name="hubspot"
      data-src="//js-na1.hs-scripts.com/XXXXX.js"
    ></script>

Steps to reproduce

When I accept the klaro cookie consent (when enabling hubspot), it automatically display the hubspot cookie banner.

Expected behavior

The hubspot cookie consent value should be set equal to the klaro value.

Morzanne commented 1 year ago

Up, it indeed does behave weird for me too :) Whenever we decline hubspot, it loads the hubspots scripts anyway. Thus (is it because react is an SPA ?) we have to reload the page to make it relevant. Any idea ?