Server-side tracking with the Meta Conversions API on any website with Cloudflare
Send every purchase from your website to Meta from the server through the Meta Conversions API, with Advanced Matching and the script served from your own domain.
Each purchase is confirmed from the purchase your order confirmation page reports and sent to your Meta pixel from the server, through the Meta Conversions API. Nothing in the browser talks to Meta, so an ad blocker has nothing to block. Each event carries hashed customer data for Advanced Matching.
Prerequisites
- Workspace admin in Product Metrics (editor is enough for the store and destination steps), with Pro (Full Signal Tracking).
- Your website’s domain on Cloudflare DNS, with its record proxied (the orange cloud), and a workspace admin who can sign in to that Cloudflare account.
- Access to your pixel in Meta Events Manager, to copy its ID and generate a Conversions API access token.
Set it up with AI
Connect your assistant
First time? Add the Product Metrics MCP server to your assistant, then paste the prompt below.
In Claude, choose Add custom connector; in ChatGPT, Settings → Apps & Connectors. Paste this URL:
https://www.productmetrics.io/mcpClaude Code: run this in your terminal.
claude mcp add --transport http product-metrics https://www.productmetrics.io/mcpPaste the prompt into your assistant.
Set up server-side conversion tracking for my website (tracked with Cloudflare Tracking) in Meta with Product Metrics. Check my setup status first, walk me through each open step, and give me the link when I need to click something.Set up server-side conversion tracking for my website (tracked with Cloudflare Tracking) in Meta with Product Metrics. Check my setup status first, walk me through each open step, and give me the link when I need to click something.Set up server-side conversion tracking for my website (tracked with Cloudflare Tracking) in Meta with Product Metrics. Use the Product Metrics MCP server, or the productmetrics CLI with --json and the Product Metrics skills if they are installed (run `productmetrics help agents` first), and tell me when a step needs me in a browser.Set up server-side conversion tracking for my website (tracked with Cloudflare Tracking) in Meta with Product Metrics. Use the Product Metrics MCP server, or the productmetrics CLI with --json and the Product Metrics skills if they are installed (run `productmetrics help agents` first), and tell me when a step needs me in a browser.In the app
1. Connect your website and Meta
- Website: add your website in Product Metrics, then sign in to Cloudflare and link the website to your property. See Any website (Cloudflare).
- Meta: in Events Manager, copy your Pixel or Dataset ID and generate a Conversions API access token, then add both under Tracking → Meta Conversions API → Connect Meta and send a test event. See Meta.
You should see: the gateway card says Gateway setup complete; Events Manager shows the test event under Test events.
2. Choose your consent banner
In Product Metrics, open Tracking → Configure consent and choose the banner your website shows: OneTrust, Cookiebot, Usercentrics or Osano. See Consent.
Meta has no consent mode. Product Metrics sends an event only when the visitor allowed ad user data; the custom events also need analytics consent. A wrong banner here means nothing reaches Meta.
You should see: Configure consent names the banner your website actually shows.
3. Create custom conversions
In Events Manager, create a custom conversion for each Product Metrics value you want to bid on, with the rule pm_purpose equals the purpose: PMOrderRevenue (ORDER_REVENUE) for revenue, PMOrderProfit (ORDER_PROFIT) for profit, every other event in Meta events. Follow Create custom conversions in Meta once a test order has reached Meta.
You should see: your custom conversions show in Events Manager.
4. Check it works
Place a test order through to the order confirmation page.
You should see: Tracking → Check your purchases shows Last purchase received within two minutes, and Live endpoints lists the Tracking SDK and Event collector on your domain; in Events Manager, the order shows as Purchase, plus the Product Metrics custom events your visitor’s consent allows. More checks: Check tracking works.
Troubleshooting
The event isn’t in Meta’s custom conversion selector
Meta lists an event only after it received it. Place a test order with all cookies accepted, then create the custom conversion.
FAQ
Do I need to change my website’s code for Meta?
No. Setup is signing in to Cloudflare: a gateway on your zone serves the Tracking SDK and Event collector on your own domain, and the order goes to Meta through the Meta Conversions API.
Can I keep my Meta pixel?
Yes. Meta counts an event once when the pixel and the Meta Conversions API send the same event name and event ID within 48 hours. Purchase uses the order transaction ID, so it deduplicates on its own.
How does Meta get profit from my website orders?
Website orders carry no product costs, so set Product cost fallback (%) plus your additional costs under Costs. PMOrderProfit then carries profit; a loss-making order is sent with value 0, as Meta accepts no negative value.
Are refunds on my website sent to Meta?
No. Product Metrics tracks the refund in your profit and lifetime value, but sent Meta events aren’t revised.
Where next
- Any website (Cloudflare): the full platform setup
- Meta: what Product Metrics sends and how to troubleshoot it
- Server-side tracking for any website (Cloudflare) in Google Ads: the same website, the other channel
- Meta Conversions API on any website (Cloudflare): the customer data each event carries
- Server-side conversion tracking: every platform and channel
- On the website: Full Signal Tracking, ad blocker conversion tracking check, first-party cookie