The Conversions API (CAPI) lets your server send conversion events to Meta. It improves measurement, but only if events are well-formed, correctly hashed and deduplicated with the Pixel.

Server-side tracking architecture: browser, gateway, normalise and hash, batch, Meta Graph API
Collect, normalise, hash, batch, send.

From my own work: I built an open-source CAPI gateway in TypeScript for WooCommerce and custom sites. The bugs that hurt match quality were phone numbers without country codes and emails hashed before lowercasing.

Event payload

POST https://graph.facebook.com/{API_VERSION}/{PIXEL_ID}/events?access_token=...
{
  "data": [{
    "event_name": "Purchase",
    "event_time": 1794300000,
    "event_id": "order-10482",
    "action_source": "website",
    "event_source_url": "https://example.com/checkout/order-received/10482/",
    "user_data": {
      "em": ["<sha256 of lowercased trimmed email>"],
      "ph": ["<sha256 of digits incl. country code, e.g. 8801712345678>"],
      "client_ip_address": "203.0.113.5",
      "client_user_agent": "Mozilla/5.0 ...",
      "fbp": "fb.1.1794299000.123456789"
    },
    "custom_data": { "currency": "BDT", "value": 2490.00 }
  }]
}

Fields and rules are in the Conversions API docs.

Normalise, then hash

  • Email: trim and lowercase, then SHA-256.
  • Phone: digits only with country code (Bangladesh 01712345678 → 8801712345678), then SHA-256.
  • Names, city, zip: lowercase, remove punctuation/spaces as specified (customer information parameters).
  • Do not hash IP, user agent, fbp or fbc.

Deduplication

Use the same event_name + event_id in the Pixel and server event (dedup guide). Order IDs are ideal for Purchase.

Reliability

  • Batch events and retry 429/5xx with exponential backoff.
  • Write failed batches to a dead-letter store for replay.
  • Verify webhook signatures (e.g. WooCommerce HMAC-SHA256) before trusting server events.
  • Log event names and counts, never raw emails or phone numbers.

Testing

Send with a test_event_code and check Test Events and Event Match Quality in Events Manager. Marketing setup basics are on saizul.com’s Pixel and CAPI guide.

Want this done on your own server or site?

I am Saizul Amin, a web developer and technical SEO consultant. I set up and harden VPS servers, migrate WordPress sites, fix indexing problems and build automations. See my portfolio or get in touch.

FAQ

Can I send events without the Pixel?

Yes, but Meta recommends both for best coverage, with deduplication.

Which hash function does Meta require?

SHA-256 of the normalised value, hex-encoded.

How quickly must events be sent?

Send as close to real time as possible; old events are less useful and may be rejected beyond Meta’s time limits.

Sources

NEW BLOGS. REAL STRATEGIES. REAL RESULTS.

Join our community and receive powerful SEO tips, web optimization guides, and growth strategies as soon as they’re published.

Don’t just read blogs — stay ahead of the competition.

We don’t spam! Read our privacy policy for more info.

Share.
Leave A Reply