How to configure Automatic cookie blocking for a service

Automatic cookie blocking prevents cookies from being set before consent by delaying the loading of the service that sets them.

Important: Automatic cookie blocking is not used when CookieHub is implemented via Google Tag Manager (GTM).

In GTM, Additional Consents are used to prevent tags from triggering before the required cookie consent.

To use automatic cookie blocking, CookieHub must be installed directly as an HTML tag on your site.


Step 1 – Enable automatic cookie blocking

  1. Go to your Domain settings > Settings tab.
  2. Toggle Automatic cookie blocking to Enabled.

Step 2 – Configure automatic cookie blocking for a service

  1. Go to Cookies & Services.
  2. Select the service in the left-hand list.

    Click Edit service.

    In the service dialog:

    • For predefined blocking rules – The rule is already configured and cannot be edited. You can disable blocking for this service by unchecking Automatic cookie blocking.
    • For custom blocking rules – Check Automatic cookie blocking and configure the search section and pattern (see below).

Step 3 – Create custom blocking rules (if needed)

Custom rules let you define exactly which scripts or resources CookieHub should block until consent is given.

Search section options

Choose where CookieHub should look for the pattern:

  • Value of the src property – Checks the URL in the src attribute of a <script> tag.
<script src="https://externalservice.domain/file.js"></script>
  • Script inline content – Checks the code between <script> tags.
<script>
  // Custom code
</script>

Pattern

Enter the text to match in the selected search section. Example:

If the pattern is externalservice.domain and the search section is Value of src property, CookieHub will block:

<script src="https://externalservice.domain/file.js"></script>

Step 4 – Save and publish changes

After enabling or configuring automatic cookie blocking:

  1. Click Save service in the dialog.
  2. Click Save & publish in the top-right corner of the dashboard.