About CAPI
Use of Conversion API (CAPI) – Development & Examples
Conversion API (CAPI) is a server-side tracking method used by platforms like Meta (Facebook & Instagram) and Google to track conversions more accurately by sending data directly from the server instead of the browser.
1. What Is Conversion API?
Conversion API allows businesses to send user interaction data such as purchases, leads, and form submissions directly from their server to advertising platforms. This avoids data loss caused by ad blockers, browser restrictions, and cookie limitations.
Simple Meaning:
Browser Tracking (Pixel) ❌ → Limited & unreliable
Server Tracking (CAPI) ✅ → Accurate & stable
Browser Tracking (Pixel) ❌ → Limited & unreliable
Server Tracking (CAPI) ✅ → Accurate & stable
2. Why Conversion API Is Important
- Accurate conversion tracking
- Better attribution & optimization
- Works even with ad blockers
- Improves Meta & Google algorithm learning
- Future-proof tracking (cookieless era)
3. Pixel vs Conversion API
| Feature | Pixel | Conversion API |
|---|---|---|
| Tracking Type | Browser-based | Server-based |
| Accuracy | Medium | High |
| Ad Blockers | Affected | Not affected |
| Future Ready | Low | High |
4. Use Cases of Conversion API
- Purchase tracking for eCommerce
- Lead form submissions
- WhatsApp click tracking
- Subscription & signups
- Offline conversions
5. How to Develop Conversion API (Step-by-Step)
Step 1: Collect Event Data
- Event name (Purchase, Lead, AddToCart)
- User data (email, phone – hashed)
- Event time
- Event source URL
Step 2: Server Setup
- Use backend (Node.js, PHP, Python)
- Or use Google Tag Manager Server-Side
- Secure API token from ad platform
Step 3: Send Data to Platform API
Server sends conversion data directly to Meta or Google servers.
6. Example of Meta Conversion API (Purchase Event)
POST https://graph.facebook.com/v18.0/PIXEL_ID/events?access_token=ACCESS_TOKEN
{
"data": [
{
"event_name": "Purchase",
"event_time": 1700000000,
"action_source": "website",
"event_source_url": "https://example.com/thank-you",
"user_data": {
"em": ["HASHED_EMAIL"],
"ph": ["HASHED_PHONE"]
},
"custom_data": {
"currency": "INR",
"value": 1999
}
}
]
}
Note: Email & phone must be SHA-256 hashed before sending.
7. Using Pixel + Conversion API Together
Best practice is to use both Pixel and CAPI together with Event Deduplication.
- Pixel tracks browser events
- CAPI tracks server events
- Event ID avoids duplicate counting
8. Conversion API via Google Tag Manager (Recommended)
- Set up GTM Server container
- Connect Meta / Google endpoints
- Map GA4 or web events
- Enable event deduplication
9. Metrics Improved by Conversion API
- Higher conversion accuracy
- Lower CPA
- Better ROAS
- Improved attribution
Final Formula:
Pixel + Conversion API + Proper Events = Maximum Tracking Accuracy
Pixel + Conversion API + Proper Events = Maximum Tracking Accuracy
Comments
Post a Comment