Setting the file. One moment.
Chapter 04 · Cloudflare Deploy
Subchapter 4.307
references/zaraz/README.mdMarkdown4 KBView on GitHub
Expert guidance for Cloudflare Zaraz - server-side tag manager for loading third-party tools at the edge.
Zaraz offloads third-party scripts (analytics, ads, chat, marketing) to Cloudflare’s edge, improving site speed, privacy, and security. Zero client-side performance impact.
Core Concepts:
// Track page view
zaraz.track('page_view');
// Track custom event
zaraz.track('button_click', { button_id: 'cta' });
// Set user properties
zaraz.set('userId', 'user_123');Use Zaraz when:
Use Workers directly when:
| File | Purpose | When to Read |
|---|---|---|
| api.md | Web API, zaraz object, consent methods | Implementing tracking calls |
| configuration.md | Dashboard setup, triggers, tools | Initial setup, adding tools |
| patterns.md | SPA, e-commerce, Worker integration | Best practices, common scenarios |
| gotchas.md | Troubleshooting, limits, pitfalls | Debugging issues |
| Task | Files to Read |
|---|---|
| Add analytics to site | README → configuration.md |
| Track custom events | README → api.md |
| Debug tracking issues | gotchas.md |
| SPA tracking | api.md → patterns.md (SPA section) |
| E-commerce tracking | api.md#ecommerce → patterns.md#ecommerce |
| Worker integration | patterns.md#worker-integration |
| GDPR compliance | api.md#consent → configuration.md#consent |
What do you need?
├─ Track events in browser → api.md
│ ├─ Page views, clicks → zaraz.track()
│ ├─ User properties → zaraz.set()
│ └─ E-commerce → zaraz.ecommerce()
│
├─ Configure Zaraz → configuration.md
│ ├─ Add GA4/Facebook → tools setup
│ ├─ When tools fire → triggers
│ └─ GDPR consent → consent purposes
│
├─ Integrate with Workers → patterns.md#worker-integration
│ ├─ Enrich context → Context Enrichers
│ └─ Inject tracking → HTML rewriting
│
└─ Debug issues → gotchas.md
├─ Events not firing → troubleshooting
├─ Consent issues → consent debugging
└─ Performance → debugging toolsThis skill focuses exclusively on Zaraz. For Workers development, see cloudflare-workers skill.