Zaraz Native Consent Bridge
How WP Zbridge passes visitor consent to Cloudflare Zaraz consent purposes and Google Consent Mode v2.
Zaraz Native Consent Bridge
Section titled โZaraz Native Consent BridgeโCloudflare Zaraz can hold each tool until the visitor grants the consent purpose assigned to it. WP Zbridge turns this on whenever something on your site collects consent:
- the built-in cookie banner is enabled, or
- Hold Zaraz tools until a consent plugin grants consent is checked (for Complianz, Cookiebot, CookieYes, Borlabs Cookie 3 or the WP Consent API).
Re-export or re-sync your container after changing either setting.
Purposes
Section titled โPurposesโThe container defines two purposes and hides the Zaraz consent modal, because your banner or consent plugin collects consent:
| Purpose ID | Name | Tools |
|---|---|---|
wpzan | Analytics | Google Analytics 4 |
wpzmk | Marketing | Meta, Google Ads, TikTok, Snapchat, Pinterest, Bing, LinkedIn |
The Instagram embeds tool has no purpose: it shows page content rather than tracking, so it is never held back.
How consent reaches Zaraz
Section titled โHow consent reaches ZarazโEvery consent source calls one helper, window.wpZbridgeConsent.update(analytics, marketing), which:
// Google Consent Mode v2 for GA4 and Google Adszaraz.set('google_consent_update', { ad_storage: 'granted', ad_user_data: 'granted', ad_personalization: 'granted', analytics_storage: 'granted'});
// Zaraz consent purposes (after the zarazConsentAPIReady event), one at a time,// skipping any purpose Zaraz doesn't know (for example Marketing on a GA4-only site)zaraz.consent.set({ wpzan: true });zaraz.consent.set({ wpzmk: true });// Send the pageviews Zaraz held back while waiting for consentzaraz.consent.sendQueuedEvents();Default Consent Mode values are sent with zaraz.set('google_consent_default', { ... }) in the page <head>.