Console Logging Blocked Scripts/Cookies

  • Updated
If you would like to see what has been blocked on a particular page of your site, you can do so by adding the following event listeners and console logging immediately after loading the Osano CMP. 
window.Osano.cm.addEventListener("osano-cm-cookie-blocked", function (item) {
console.log("Cookie blocked: " + item);
});
window.Osano.cm.addEventListener("osano-cm-script-blocked", function (item) {
console.log("Script blocked: " + item);
});

Once the CMP has initialized, the console will log all scripts and cookies that have been blocked on that particular page. 

 

Code Example: 

<script src="https://cmp.osano.com/<customerId>/<configId>/osano.js"></script>
<script>
  window.Osano.cm.addEventListener("osano-cm-script-blocked", function (item) {
      console.log("Script blocked: " + item);
  });
  window.Osano.cm.addEventListener("osano-cm-cookie-blocked", function (item) {
      console.log("Cookie blocked: " + item);
  });
</script>