You can check if user has consented using the hasConsented method. This can be done in other javascript files or any inline javascript block. Make sure Cookie Consent is included above this in your web page's source.


<script type="text/javascript">
window.addEventListener("load", function() {
  if (cookieconsent.hasConsented("analytics"))
  {
    console.log('Analytical cookies allowed');
  }
});
</script>