Advanced · Chapter 1 · Last updated 2026-10-01
Meta CAPI server-side events
Browsers lose 30–40% of events. This chapter adds an endpoint beside your existing landing page to recover them and let Meta know both copies are one event.
In this chapter
- Why browser-side events aren't enough, and how to measure the loss rate in your own account
- Why the drag-and-drop upload taught in Basic can't hold back-end code, and which deployment method to switch to
- Writing a Cloudflare Pages Function that receives events, adds the real IP and UA (user agent), and forwards them to Meta
- Where to keep the token so it doesn't leak, and why it must never appear in the front end
- Deduplication, or how to make Meta count a conversion once when it's sent twice
- A timestamp rule that gets a whole batch of events rejected, and three health checks after launch
Terms in this chapter: Conversions API, Deduplication, Event match quality, Test Events tool, fbclid, fbc and fbp