Skip to content

Google Analytics 4 (GA4) Recipe

Connect Google Analytics 4 to Cloudflare Zaraz in 1 click for faster pages and accurate e-commerce tracking.

Google Analytics 4 (GA4) Built-in Recipe

Section titled “Google Analytics 4 (GA4) ”

Running Google Analytics 4 through Cloudflare Zaraz means your pages don’t load Google’s gtag.js. Zaraz sends events to GA4 from Cloudflare’s servers.


You only need your GA4 Measurement ID (starts with G-, e.g. G-ABC123XYZ4).

Where to find it:

  1. Open Google Analytics.
  2. Click the gear icon (Admin) in the bottom left.
  3. Click Data Streams under Data Collection.
  4. Click your website stream and copy the Measurement ID.

  1. Go to WP Zbridge > Zaraz Recipes in your WordPress dashboard.
  2. Toggle on Google Analytics 4 and paste your G-XXXXXXXXXX ID.
  3. Click Sync to Zaraz (Pro), or Download Container JSON and import it in Cloudflare (Lite).

Once the container is published in Zaraz, GA4 receives your site’s events through Zaraz. Remove any other GA4 tag so page views aren’t counted twice.


WooCommerce actions are sent as Zaraz e-commerce events, which Zaraz converts to GA4 e-commerce events:

Customer ActionGA4 EventDetails Sent
Browsing pagespage_viewPage title and URL
Viewing a productview_itemProduct ID, name, price, category
Adding to cartadd_to_cartProduct details and quantity
Removing from cartremove_from_cartProduct details and quantity
Viewing the cartview_cartCart products and value
Starting checkoutbegin_checkoutCart products and value
Choosing a payment method (Pro)add_payment_infoPayment method
Completing an orderpurchaseTransaction ID, value, tax, shipping, coupon, products
Refund (Pro)refundTransaction ID and refunded amount
Searching the siteview_search_resultsSearch term
Submitting a formgenerate_leadForm ID and form plugin

Engagement events (scroll, file_download, click and others) are listed in the events matrix.