Usage

Checking for 3rd party cookies dynamically

Using js_type_for_cookie_consent templatetag for script type attribute would set x/cookie_consent thus making browser skip executing this block of javascript code.

When consent for using specific cookies is given, code can be evaluated without reloading page.

{% load cookie_consent_tags %}
<script type="{% js_type_for_cookie_consent request "social" "*:.google.com" %}" data-varname="social">
  alert("Social cookie accepted");
</script>