How to Set Up Meta Conversions API (CAPI) on WordPress & Next.js in Malaysia
Bypass iOS 14+ tracking loss and ad blockers. Step-by-step server-side Meta Conversions API (CAPI) implementation with event deduplication in Malaysia.
Since Apple introduced iOS App Tracking Transparency and browsers tightened third-party cookie restrictions, client-side Meta Pixels lose between 30% and 45% of purchase and lead events in Malaysia.
When Meta cannot see who converted, your cost-per-acquisition (CPA) spikes because the algorithm cannot optimize effectively.
The solution is Meta Conversions API (CAPI): sending conversion events directly from your server backend to Meta's Graph API.
1. How CAPI Works (Server-to-Server vs. Browser)
[User Browser] ------ (Ad Blocker / iOS Drops Pixel) ------> [Meta Server] ❌ LOST (35%)
│
└───> [Your Node / Next.js / PHP Server] ──(CAPI HTTPS POST)──> [Meta Graph API] ✅ 100% RECEIVED
2. Event Deduplication Architecture
To prevent counting the same conversion twice when both Pixel and CAPI fire, you must pass an identical event_id and event_name from both sides:
// Server-side Node.js / Next.js CAPI Payload
const eventPayload = {
data: [
{
event_name: "Purchase",
event_time: Math.floor(Date.now() / 1000),
event_id: `order_${order.id}`, // Matching browser event_id
user_data: {
em: hashSha256(customer.email),
ph: hashSha256(customer.phone), // Include +60 country code
client_ip_address: req.headers["x-forwarded-for"],
client_user_agent: req.headers["user-agent"],
},
custom_data: {
currency: "MYR",
value: order.totalAmount,
},
action_source: "website",
},
],
};
await fetch(`https://graph.facebook.com/v19.0/${PIXEL_ID}/events?access_token=${META_ACCESS_TOKEN}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(eventPayload),
});
3. Verifying Event Match Quality in Events Manager
After deploying CAPI:
- Open Meta Events Manager > Test Events.
- Trigger a live test purchase or form submission.
- Verify that the event displays "Browser + Server" with a deduplication badge.
- Target an Event Quality Match Score >= 8.0/10.
Need Server-Side Tracking Configured on Your Site?
JagaWeb implements enterprise CAPI pipelines on Cloudflare Workers, Next.js, and WordPress.
Ready to verify who owns your website?
Replace uncertainty with a decision-ready ownership and access report. The fixed Ownership & Access Review is RM1,500 before SST and includes a 30-day action plan.