Please note! This is an outdated article intended for CookieHub v1. Please upgrade to CookieHub v2 and use the latest article: https://support.cookiehub.com/hc/en-us/sections/360007463411-JavaScript-API
--
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 CookieHub 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>
Comments
0 comments
Please sign in to leave a comment.