Introduction
Facebook Conversions API (CAPI) is Meta's server-side tracking solution that sends conversion events directly from your server to Facebook. This guide will walk you through configuring CAPI in ServerTrack, from finding your Pixel ID to generating an Access Token and completing the setup.
Benefits of CAPI: Bypasses ad blockers, improves data accuracy, extends cookie attribution windows, and provides better event match quality (EMQ) scores.
What is Facebook Conversions API?
Facebook Conversions API (CAPI) is a server-to-server integration that allows you to send conversion events directly from your server to Facebook's servers, bypassing browser-based tracking limitations. When used alongside the Facebook Pixel (browser-side), CAPI provides:
- Improved Data Accuracy: Captures events missed by browser-based tracking (30-40% improvement)
- Better Attribution: Extended cookie windows (up to 2 years vs 7 days for browser cookies)
- Ad Blocker Resistance: Server-side requests aren't blocked by ad blockers
- Enhanced Privacy: More compliant with GDPR and privacy regulations
- Event Deduplication: Automatically deduplicates browser and server events using Event IDs
Step 1: Find Your Facebook Pixel ID
Your Pixel ID is a 15-16 digit number that identifies your Facebook Pixel. Here's how to find it:
- Log in to your Facebook Business Manager
- Go to Events Manager (or navigate to business.facebook.com/events_manager)
- In the left sidebar, click "Data Sources"
- Select your Pixel (or create a new one if you don't have one)
- Your Pixel ID is displayed at the top - it looks like:
1234567890123456
Note: If you don't have a Pixel yet, click "Connect Data Sources" → "Web" → "Facebook Pixel" to create one. You'll need admin access to your Facebook Business Manager.
Step 2: Generate an Access Token
An Access Token authorizes ServerTrack to send events to Facebook on your behalf. Here's how to generate one:
Method 1: Using Events Manager (Recommended)
- In Events Manager, select your Pixel
- Click on the "Settings" tab
- Scroll down to "Conversions API" section
- Click "Set up manually" or "Generate access token"
- Click "Generate new token"
- Copy the token immediately (you won't be able to see it again)
Method 2: Using Business Settings
- Go to Business Settings → System Users
- Create a new System User or select an existing one
- Assign the System User to your Pixel with "Manage" permissions
- Generate a token for the System User
- Grant the following permissions:
ads_managementbusiness_management
- Copy the generated token
Security Warning: Treat your Access Token like a password. Never share it publicly or commit it to version control. If compromised, regenerate it immediately.
Step 3: Configure ServerTrack
Now that you have your Pixel ID and Access Token, configure them in ServerTrack:
- Log in to your ServerTrack dashboard
- Select your Server Deck, go to Edit Configuration
- Navigate to the "Facebook CAPI" tab (or Integration Settings)
- Enter your Pixel ID in the "Pixel ID" field
- Enter your Access Token in the "Access Token" field
- Click "Save Configuration" or "Update Settings"
Success: After saving, ServerTrack will validate your credentials. If valid, you'll see a success message and your Facebook CAPI integration will be active.
Step 4: Configure Events Manager Settings
Complete the setup in Facebook Events Manager for optimal performance:
Enable Event Deduplication
- In Events Manager, go to your Pixel Settings
- Scroll to "Conversions API" section
- Enable "Deduplicate server and browser events"
- Ensure "Event ID" matching is enabled
This ensures that when both your browser pixel and ServerTrack send the same event (with matching Event IDs), Facebook only counts it once.
Add Your Tracking Domain
- In Events Manager → Settings → Conversions API
- Under "Allowed Domains", add your ServerTrack domain (e.g.,
data.yoursite.com) - This tells Facebook to trust events coming from your tracking domain
Step 5: Test Your Integration
Verify that your CAPI setup is working correctly:
Test in ServerTrack Dashboard
- Go to your ServerTrack dashboard → Event Logs
- Trigger a test event on your website (or use the test button if available)
- Check the event log - the Facebook status should show "success" or "sent"
- If you see errors, check the response message for details
Test in Facebook Events Manager
- In Facebook Events Manager, go to "Test Events"
- Enter your website URL
- Trigger an event on your website
- You should see the event appear in real-time with the source showing as "Conversions API"
Tip: Use Facebook's Test Events tool regularly during setup to verify events are being received correctly. Events marked with "Conversions API" indicate they're coming from server-side tracking.
Common Issues and Solutions
Invalid Access Token Error
Symptoms: Events show as "failed" in ServerTrack logs with "Invalid access token" message.
Solutions:
- Verify the token was copied correctly (no extra spaces)
- Check that the token hasn't expired (some tokens expire after 60 days)
- Ensure the System User has correct permissions
- Regenerate the token and update it in ServerTrack
Events Not Appearing in Events Manager
Symptoms: Events show as "success" in ServerTrack but don't appear in Facebook Events Manager.
Solutions:
- Check that your Pixel ID is correct
- Verify the event is not being filtered out (check Events Manager filters)
- Ensure deduplication is working correctly (check Event IDs match)
- Wait a few minutes - there can be a delay in Facebook's reporting
Deduplication Not Working
Symptoms: You see duplicate events in Events Manager (one from Pixel, one from CAPI).
Solutions:
- Ensure Event IDs match between browser and server events
- Verify deduplication is enabled in Events Manager settings
- Check that Event ID format is correct (should be unique per event)
Best Practices
- Use Both Pixel and CAPI: Run both browser pixel and server-side CAPI for maximum data coverage
- Match Event IDs: Use the same Event ID for both browser and server events to enable deduplication
- Include User Data: Send email, phone, and other user data (hashed) for better event match quality
- Monitor Event Match Quality: Check EMQ scores in Events Manager regularly
- Token Security: Regenerate tokens periodically for security (every 60-90 days)
Next Steps
Once your Facebook CAPI is configured and tested:
- Implement event tracking on your website (Purchase, AddToCart, etc.)
- Monitor event logs in ServerTrack dashboard
- Check Event Match Quality scores in Facebook Events Manager
- Optimize user data collection to improve EMQ
For more information, see our guides on Tracking Purchase Events and Improving Event Match Quality.