Skip to main content

Zaraz

Learning Focus

By the end of this lesson you will understand how Zaraz replaces traditional tag managers, why it's faster and more private, and how to set it up.

What Is Zaraz?

Zaraz is Cloudflare's server-side tag manager. Instead of loading third-party scripts (Google Analytics, Facebook Pixel, etc.) directly in the browser, Zaraz loads them at the edge — keeping your pages fast and your users' data private.

flowchart LR
subgraph Traditional["Traditional Tag Manager"]
T_PAGE["Your Page"] --> T_GTM["GTM Script\n(Browser)"]
T_GTM --> T_GA["Google Analytics\n(Browser)"]
T_GTM --> T_FB["Facebook Pixel\n(Browser)"]
T_GTM --> T_OTHER["Other Scripts\n(Browser)"]
end

subgraph Zaraz["Cloudflare Zaraz"]
Z_PAGE["Your Page"] --> Z_EDGE["Zaraz\n(Cloudflare Edge)"]
Z_EDGE --> Z_GA["Google Analytics\n(Server-side)"]
Z_EDGE --> Z_FB["Facebook Pixel\n(Server-side)"]
Z_EDGE --> Z_OTHER["Other Services\n(Server-side)"]
end

style T_GTM fill:#dc2626,color:#fff,stroke:#b91c1c
style Z_EDGE fill:#16a34a,color:#fff,stroke:#15803d

Why Zaraz?

FeatureTraditional Tag ManagerZaraz
Page speedSlows page (many JS scripts in browser)Fast (single lightweight script)
PrivacyScripts see full user dataData filtered at edge before sending
Third-party code in browser✅ Full access to DOM, cookies❌ Scripts run server-side
Cookie consentComplex consent managementBuilt-in consent management
CostFree (GTM) to expensiveFree (with limits)

Free Tier

ResourceFree Plan
Events1 million per month
ToolsUnlimited
Consent management
Custom actions20 per tool

Setting Up Zaraz

  1. Go to Cloudflare Dashboard → Zaraz
  2. Zaraz is automatically active on proxied domains — no script tag needed
  3. Click "Add new tool"
  4. Select from supported integrations:

Supported Tools

CategoryExamples
AnalyticsGoogle Analytics 4, Bing UET, Plausible, Fathom
MarketingFacebook Pixel, Google Ads, LinkedIn Insight
Customer supportIntercom, Zendesk, Crisp
A/B TestingGoogle Optimize, Optimizely
CustomCustom events, HTTP endpoints

Example: Adding Google Analytics 4

  1. Click "Add new tool" → Select Google Analytics 4
  2. Enter your Measurement ID (G-XXXXXXXXXX)
  3. Configure triggers:
    • Page View: Fires on every page load
    • Custom Events: Configure specific event triggers
  4. Save — Google Analytics is now running server-side via Zaraz

Zaraz includes a built-in consent management tool:

  1. Go to Zaraz → Consent
  2. Define consent purposes (Analytics, Marketing, Functionality)
  3. Assign tools to purposes
  4. Zaraz automatically shows a consent banner and only fires tools that the user has consented to

This helps with GDPR, CCPA, and other privacy regulations without additional consent management solutions.

Common Misconceptions

"Zaraz is just another tag manager like GTM"

Reality: Zaraz fundamentally differs from GTM by running third-party code server-side (at Cloudflare's edge), not in the user's browser. This eliminates third-party JavaScript from your pages, improving speed, security, and privacy.

"Zaraz requires removing existing analytics"

Reality: You can migrate gradually. Run Zaraz alongside existing scripts, verify data parity, then remove the client-side scripts.

Key Takeaways

  • Zaraz is a server-side tag manager that runs third-party scripts at the edge — not in the browser.
  • Faster pages — one lightweight script replaces many heavy third-party scripts.
  • Better privacy — data is filtered at the edge before being sent to third parties.
  • Built-in consent management for GDPR/CCPA compliance.
  • Free tier: 1M events/month, unlimited tools.

What's Next