Introduction
Test codes are used to send test events to Facebook Events Manager's Test Events tool, allowing you to verify tracking is working correctly without affecting production data. This guide explains how test codes work, how to set them up, and how to troubleshoot issues.
What is Test Code: Test codes are unique identifiers that tell Facebook to send events to the Test Events tool instead of production. This allows you to verify tracking without affecting real campaign data.
What is Test Code?
Test codes are Facebook-specific codes used for testing:
- Purpose: Send events to Facebook Test Events tool for verification
- Format: Unique alphanumeric code (e.g., "TEST12345")
- Where Used: Facebook Conversions API events
- When Active: Only when test status is enabled in ServerTrack
Test codes ensure test events appear in Facebook Events Manager → Test Events, making it easy to verify tracking without affecting production events.
How Test Codes Work
1. Getting Your Test Code
- Go to Facebook Events Manager
- Navigate to Settings → Test Events
- Find or generate a Test Event Code
- Copy the test code
2. Configuring in ServerTrack
- Go to your Server Deck settings
- Find "Test Event Setup" section
- Paste your Facebook test code
- Enable "Test Status" (turn it on)
- Save settings
3. How It Works
- When test status is enabled, ServerTrack includes test code in Facebook API requests
- Facebook routes events with test codes to Test Events tool
- Test events appear in Events Manager → Test Events in real-time
- Production events continue to work normally
Common Issues
1. Test Events Not Appearing in Facebook
Symptoms: Events not showing in Facebook Test Events tool.
Causes:
- Test status not enabled in ServerTrack
- Test code is incorrect or invalid
- Test code expired or was deleted in Facebook
- Events not being sent to Facebook (authentication issues)
- Test code not included in API requests
Solution:
- Verify test status is enabled in ServerTrack dashboard
- Check test code matches Facebook Events Manager exactly
- Generate new test code in Facebook if needed
- Verify Facebook credentials (Pixel ID, Access Token) are correct
- Check Event Logs to see if events are being sent to Facebook
- Ensure events are successful (not failed or blocked)
2. Wrong or Invalid Test Code
Symptoms: Error messages or test events not appearing.
Causes:
- Test code copied incorrectly (typos, extra spaces)
- Test code from wrong Facebook account/pixel
- Test code expired or deleted
Solution:
- Go to Facebook Events Manager → Settings → Test Events
- Generate or copy a fresh test code
- Ensure you're using the correct pixel's test code
- Paste test code into ServerTrack (no extra spaces)
- Save settings and test again
3. Test Status Not Enabled
Symptoms: Events not going to Test Events even with test code configured.
Causes:
- Test status toggle is off in ServerTrack
- Test code is set but test mode is disabled
Solution:
- Go to Server Deck settings
- Find "Test Event Setup" section
- Ensure "Test Status" is enabled (toggle is ON)
- Verify test code is entered
- Save settings
4. Events Not Reaching Facebook
Symptoms: No events in Test Events or production events.
Causes:
- Facebook credentials (Pixel ID, Access Token) incorrect
- Facebook authentication failures
- Events blocked or failed in ServerTrack
Solution:
- Verify Facebook Pixel ID and Access Token are correct
- Check Event Logs for Facebook authentication errors
- Ensure events are successful (not blocked or failed)
- Test Facebook credentials in Events Manager
- Regenerate Access Token if needed
Setting Up Test Code Step-by-Step
Step 1: Get Test Code from Facebook
- Log in to Facebook Events Manager
- Select your Pixel
- Go to Settings → Test Events
- Find your Test Event Code (or generate a new one)
- Copy the code (e.g., "TEST12345")
Step 2: Configure in ServerTrack
- Log in to ServerTrack dashboard
- Select your Server Deck
- Go to Server Deck settings/edit page
- Find "Test Event Setup" section
- Paste the test code in "Test Code" field
- Enable "Test Status" toggle
- Save settings
Step 3: Test
- Trigger a test event on your website
- Go to Facebook Events Manager → Test Events
- You should see the event appear in real-time
- Verify event data looks correct
Verifying Test Code Works
1. Check ServerTrack Configuration
- Test code is entered correctly
- Test status is enabled
- Facebook credentials are configured
- Server Deck status is Active
2. Check Facebook Test Events
- Go to Events Manager → Test Events
- Clear existing test events if needed
- Trigger a test event on your website
- Event should appear within seconds
3. Check ServerTrack Event Logs
- Go to Event Logs in ServerTrack
- Find the test event
- Check status is "success" or "partial_success"
- Verify Facebook status shows success
Best Practices
- Use Test Mode During Development: Enable test mode when setting up tracking
- Disable for Production: Disable test mode once tracking is verified
- Use Separate Test Codes: Use different test codes for different environments
- Verify Regularly: Test tracking periodically to ensure it's working
- Keep Test Code Secure: Don't share test codes publicly
Enabling and Disabling Test Mode
To Enable Test Mode:
- Configure test code in ServerTrack
- Enable "Test Status" toggle
- Save settings
- Test events will go to Facebook Test Events tool
To Disable Test Mode:
- Go to Server Deck settings
- Disable "Test Status" toggle
- Save settings
- Events will go to production (normal tracking)
Important: Remember to disable test mode after testing. Test events don't affect production data, but you want production events in production, not test events.
Troubleshooting Checklist
- ✔ Test code is entered correctly (no typos, extra spaces)
- ✔ Test status is enabled in ServerTrack
- ✔ Test code matches Facebook Events Manager exactly
- ✔ Facebook Pixel ID and Access Token are correct
- ✔ Server Deck status is Active
- ✔ Events are successful in Event Logs (not blocked/failed)
- ✔ Test code is from the correct Facebook pixel
- ✔ Test code hasn't expired or been deleted
When to Contact Support
Contact ServerTrack support if:
- Test code is configured correctly but events still don't appear
- Test status toggle doesn't work
- Events are successful in logs but not appearing in Facebook Test Events
- You need help understanding test code configuration
Summary
Test codes allow you to:
- Send events to Facebook Test Events tool
- Verify tracking without affecting production data
- Debug tracking issues in real-time
- Test tracking changes safely
To set up test codes:
- Get test code from Facebook Events Manager → Settings → Test Events
- Enter test code in ServerTrack Server Deck settings
- Enable "Test Status" toggle
- Save settings
- Test by triggering events and checking Facebook Test Events
Common issues:
- Test status not enabled
- Incorrect or expired test code
- Facebook authentication issues
- Events not reaching Facebook
Remember to disable test mode after testing to ensure production events go to production.
For more information, see our Events Not Appearing in Facebook guide.