A custom blocking map can be used to customize Auto Blocker's behavior by recategorizing, blocking, or unblocking all scripts from a specific domain. To recategorize, block, or unblock a single script, use manual blocking


A custom blocking map must be defined before you load Termly’s embed script. Use the code below and customize for your site. 


Add the domains you are recategorizing in the format “example.com” and use one of the following five cookie categories: essential, performance, analytics, advertising, or social_networking. Keep this spelling and formatting to ensure the scripts are categorized correctly.


Example custom blocking map code:


<!-- Termly custom blocking map -->
<script>
  window.TERMLY_CUSTOM_BLOCKING_MAP = {
    “example.com”: “analytics”,
    “xyz.com”: “social_networking”,
  }
</script>


To ensure your custom blocking map overrides Auto Blocker defaults, load it before your Termly embed script.


Custom blocking map used with Termly embed script:


<!-- Termly custom blocking map -->
<script>
  window.TERMLY_CUSTOM_BLOCKING_MAP = {
    “example.com”: “analytics”,
    “xyz.com”: “social_networking”,
  }
</script>

<!-- Termly embed script -->
<script
  type="text/javascript"
  src="https://app.termly.io/embed.min.js"
  data-auto-block="on"
  data-website-uuid="123-abc"
></script>


Subdomain categorization


You can recategorize subdomains separately from the parent domain with a custom blocking map. Domains with higher specificity will take precedence over the general domain categorization. In the example below, "subdomain.example.com" categorization will take precedence over "example.com" categorization. 


<!-- Termly custom blocking map -->
<script>
  window.TERMLY_CUSTOM_BLOCKING_MAP = {
    “example.com”: “analytics”,
    “subdomain.example.com”: “performance”,
  }
</script>


Learn more


What is Auto Blocker?

How does Auto Blocker work?

How to install Auto Blocker