Cookie banner

Cloudflare Zaraz

Connect the cookie banner to Cloudflare Zaraz consent management so tools Zaraz loads on the server wait for the visitor's choice.

Updated 3 November 20261 min read

Cloudflare Zaraz loads third-party tools on Cloudflare's servers, not in the visitor's browser. A cookie banner running in the page cannot block them. If Zaraz sets cookies or loads tools before the visitor answered, the banner needs to hand the choice to Zaraz.

#How it works

When Zaraz exposes its consent API, the banner sends it the visitor's choice. Zaraz purposes whose name matches a category follow that category:

Zaraz purpose name containsCategory
Statistics, Analytics, Measurement, PerformanceStatistics
Marketing, Advertising, Ads, TargetingMarketing
Preferences, Functional, PersonalizationPreferences

The banner sets each matching purpose to true or false and releases the events Zaraz queued while waiting. It does this on every choice and when a page loads with a saved choice.

#Set it up in Cloudflare

  1. In Cloudflare, open Web tag management → Consent for your site.
  2. Create a purpose named Statistics (and Marketing if you use advertising tools).
  3. Under Assign purposes to tools, assign each tool to its purpose. A tool left on Skip Consent always loads.
  4. Check Enable Consent Management.
  5. Uncheck Show consent modal, so Cloudflare's own modal does not appear next to the Privacyboard banner.
  6. Save.

#Verify

In a private window, before choosing, there should be no Zaraz cookies for your tools, for example cfz_google-analytics_v4. After Accept all and a reload they appear. After Reject all they stay absent.

#FAQ

#Do I need this if I do not use Zaraz?

No. It does nothing when Zaraz is not present on your page.

#Can I use other purpose names?

The banner recognises the words above. Name your purposes accordingly, or tell us the names you need.

Privacyboard is a guidance tool, not legal advice. This page describes what the product does today. Found something unclear or out of date? Write to antoine@unmake.io.