TL;DR: Cloudflare Dashboard → Delivery & performance → Web tag management → Tag setup → Select Domain → Custom HTML → Navigate to Actions→ Paste Consently script with Pageview trigger. Deploy your consent banner through Cloudflare without editing site code using Zaraz, a cloud-based tool manager that loads scripts outside the browser.

Overview

Cloudflare Zaraz is a third-party tool manager that loads scripts through Cloudflare's edge network. Installing Consently via Zaraz improves page load performance and simplifies script management by loading the consent banner from Cloudflare's servers rather than directly from your website code.

Before You Begin

Make sure you have:

  • A Cloudflare account with an active domain. Domains purchased elsewhere can also be added to Cloudflare by following this guide.

  • Your Consently embed script code

  • Admin access to your Cloudflare dashboard

Time required: About 5 minutes

How to Install Consently via Cloudflare Zaraz

Step 1: Access your Cloudflare dashboard

Log in to the Cloudflare Dashboard and select the account with the domain where you want to add Consently.

BlockNote image

Step 2: Navigate to Zaraz settings

Navigate to Delivery & performanceWeb tag management Tag setup. Then click on the domain where you want to add Consently.

BlockNote image

Step 3: Select Custom HTML

Scroll through the tool options and click the Custom HTML card.

BlockNote image

Step 4: Confirm tool selection

In the "Set up Custom HTML" modal that appears, click Continue to proceed with configuring the tool.

BlockNote image

Step 5: Grant JavaScript execution permission

On the "Grant permissions" screen, ensure the Execute client-side JavaScript toggle is enabled, then click Continue.

BlockNote image
⚠️ Important: This permission is required for this method of integration to work.

Step 6: Configure the tool settings

You can provide a Custom Tool name in this step. Press Continue when you are done.

BlockNote image

Step 7: Set Up Custom HTML

  • Provide an Action Name

  • Choose the Firing Triggers from the dropdown

  • Paste your Consently Script in the HTML Code input field

BlockNote image

Step 8: Complete the setup

Click Save to finalize the configuration.

BlockNote image

Step 9: Verify the tool is enabled

After saving, your Custom HTML tool page will list all Custom Actions. Verify that the newly added Consently action is turned on.

BlockNote image

Done!

Your Consently consent banner is now deployed via Cloudflare Zaraz and will load automatically on all pages.

Success indicator: Launch your site in an incognito window to confirm the consent banner appears.

Benefits of Using Zaraz for Consently

  • Faster page loads – Scripts run in the cloud, not the user’s browser.

  • Reduced browser workload – Less JS execution on the client side.

  • Centralized management – Easily add, update, or remove scripts without editing site code.

  • Simplified maintenance – Avoids script removal during theme updates or site changes.

  • Improved user experience – Faster, smoother site interactions with fewer delays.


What's Next

Now that you've installed Consently via Zaraz, you should:

  1. Test your installation

  2. Configure your cookie categories

Troubleshooting

Banner not appearing after setup

Why this happens: Zaraz changes may take a few minutes to propagate, or the tool might be disabled.

Solution:

  1. Wait 5 minutes and clear your browser cache

  2. Check that the Consently tool shows "Active" status in Zaraz Tag setup

  3. Verify the Enabled toggle is switched on in the tools list

  4. Open your browser's developer console (F12) and check for any JavaScript errors


Banner appears twice

Why this happens: You may have Consently installed both directly in your site code AND via Zaraz.

Solution:

  1. Check your website's HTML source code for duplicate Consently script tags

  2. Remove any direct installations if you're using Zaraz

  3. Keep only one installation method active at a time


Script shows "Invalid banner ID" error

Solution: Verify you copied the complete embed script from your Consently dashboard, including the correct data-bannerid attribute. The banner ID is unique to your site and must match exactly.


Changes to banner design not reflecting

Why this happens: Cloudflare's edge cache may be serving an older version of your banner configuration.

Solution:

  1. Publish your banner changes in the Consently dashboard

  2. Wait 2-3 minutes for the changes to propagate

  3. Clear your browser cache and refresh the page

  4. If the issue persists, purge your Cloudflare cache: Account → Select Your Domain → Caching → Configuration → Purge Everything

Related Pages