Meta Pixel & Conversions API (CAPI) Recipe
Set up Meta (Facebook & Instagram) tracking with the server-side Conversions API.
Meta Pixel & Conversions API (CAPI) Built-in Recipe
Section titled “Meta Pixel & Conversions API (CAPI) ”The Meta Recipe sends your store’s events to Meta’s Conversions API (CAPI) from Cloudflare’s servers through Cloudflare Zaraz. Your pages don’t load Meta’s own Pixel script.
What You Need
Section titled “What You Need”- Meta Pixel / Dataset ID (Required): A numeric ID (e.g.
123456789012345) found in Meta Events Manager. - Conversions API Access Token (Required): Zaraz sends Meta events from Cloudflare’s servers through the Conversions API, so nothing reaches Meta without it. Generate it in Events Manager under your dataset’s Settings → Conversions API.
3-Step Setup
Section titled “3-Step Setup”- Go to WP Zbridge > Zaraz Recipes in WordPress.
- Toggle on Meta Pixel & CAPI and paste your Pixel ID.
- Click Sync to Zaraz (Pro), or Download Container JSON and import it in Cloudflare (Lite).
How Meta Matches Events
Section titled “How Meta Matches Events”Zaraz sends each event with the visitor’s Meta browser ID (_fbp), click ID (_fbc, from ad clicks), IP address and user agent. Meta uses these to connect events to people who saw or clicked your ads.
By default WP Zbridge does not send customer email addresses, phone numbers or other contact details to Meta.
Customer Matching on Server-Sent Purchases PRO
Section titled “Customer Matching on Server-Sent Purchases ”Under WP Zbridge > E-Commerce, Send customer details with server-sent purchases adds the buyer’s email, phone, name and address to purchases the server fallback sends. Zaraz’s Meta tool hashes them (SHA-256) and sends them as Conversions API user data, which helps Meta match those purchases. Browser events never include them. Mention this in your privacy policy and only turn it on if you have a legal basis to share the data.
Prevent Facebook Catalog Errors
Section titled “Prevent Facebook Catalog Errors”If you sell products with variations (sizes, colors), Meta’s product catalog may reject events if it only indexes the parent product.
- The Fix: Under WP Zbridge > E-Commerce, turn on Use parent ID for product variations.
- WP Zbridge then sends the parent product ID in
ViewContent,AddToCartandPurchaseevents, so they match the products in your catalog.
Events Tracked Automatically
Section titled “Events Tracked Automatically”| Customer Action | Meta Event | What’s Sent |
|---|---|---|
| Browsing any page | PageView | Page URL |
| Viewing a product | ViewContent | Product ID, name, price |
| Adding to cart | AddToCart | Product ID, price, quantity |
| Starting checkout | InitiateCheckout | Cart value and products |
| Choosing a payment method (Pro) | AddPaymentInfo | Payment method |
| Completing an order | Purchase | Order value, currency, order ID, event ID |
| Searching the site | Search | Search term |
| Submitting a form | Lead | |
| Clicking an email or phone link | Contact | |
| Creating an account (Pro) | CompleteRegistration |
Other events (for example scroll or Product Removed) reach Meta as custom events under their own names.
Lead, Contact, CompleteRegistration and custom events include their event properties as custom_data (for example form_id and form_plugin on Lead, file_name and link_url on file_download). You can use them in Meta custom conversion rules, for example to count only one form as a conversion.